File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
import json
2
2
import sys
3
+ from typing import Any
3
4
4
5
5
6
def main () -> None :
@@ -9,7 +10,7 @@ def main() -> None:
9
10
"""
10
11
11
12
# Initialize the basic CASE graph that will have the files appended
12
- case : dict = {
13
+ case : dict [ str , Any ] = {
13
14
"@context" : {
14
15
"case-investigation" : "https://ontology.caseontology.org/case/investigation/" ,
15
16
"kb" : "http://example.org/kb/" ,
Original file line number Diff line number Diff line change 3
3
from typing import Set
4
4
5
5
from rdflib import Graph , URIRef
6
+ from rdflib .query import ResultRow
6
7
7
8
8
9
class CASEOutputTests (unittest .TestCase ):
@@ -11,7 +12,7 @@ def test_graphs_exist(self) -> None:
11
12
Identifies all CASE graph files within the ./output directory and ensures there
12
13
are at least two.
13
14
"""
14
- files : list = []
15
+ files : list [ str ] = []
15
16
source_directory : str = "./output"
16
17
for file in os .listdir (source_directory ):
17
18
if file .endswith (".json" ) or file .endswith (".jsonld" ):
@@ -68,6 +69,8 @@ def test_organization_iri_found(self) -> None:
68
69
g : Graph = Graph ()
69
70
g .parse (os .path .join (source_directory , file ))
70
71
for result in g .query (query ):
72
+ assert isinstance (result , ResultRow )
73
+ assert isinstance (result [0 ], URIRef )
71
74
# Graph.query for a SELECT query returns a tuple, with
72
75
# member count as long as the number of bound variables.
73
76
computed .add (result [0 ])
You can’t perform that action at this time.
0 commit comments