@@ -29,11 +29,14 @@ def test_load(self):
29
29
cdlfile = os .path .join (self .cdl_path , 'multi_array_reference.cdl' )
30
30
with self .temp_filename ('.nc' ) as tfile :
31
31
subprocess .check_call (['ncgen' , '-o' , tfile , cdlfile ])
32
- inputs = bald .load_netcdf (tfile , cache = self .acache )
33
- set_collection = inputs .bald__contains [6 ].bald__references
34
- self .assertTrue (isinstance (set_collection , set ))
35
- list_collection = inputs .bald__contains [7 ].bald__references
36
- self .assertTrue (isinstance (list_collection , list ))
32
+ inputs = bald .load_netcdf (tfile , baseuri = 'file://CDL/multi_array_reference.nc' ,
33
+ cache = self .acache )
34
+
35
+ for contained in inputs .bald__contains :
36
+ if contained .identity == 'file://CDL/multi_array_reference.nc/list_collection' :
37
+ self .assertTrue (isinstance (contained .bald__references , list ))
38
+ elif contained .identity == 'file://CDL/multi_array_reference.nc/set_collection' :
39
+ self .assertTrue (isinstance (contained .bald__references , set ))
37
40
38
41
def test_turtle (self ):
39
42
with self .temp_filename ('.nc' ) as tfile :
@@ -43,8 +46,9 @@ def test_turtle(self):
43
46
cdl_file_uri = 'file://CDL/{}' .format (cdlname )
44
47
root_container = bald .load_netcdf (tfile , baseuri = cdl_file_uri , cache = self .acache )
45
48
ttl = root_container .rdfgraph ().serialize (format = 'n3' ).decode ("utf-8" )
46
- # with open(os.path.join(self.ttl_path, 'multi_array_reference.ttl'), 'w') as sf:
47
- # sf.write(ttl)
49
+ if os .environ .get ('bald_update_results' ) is not None :
50
+ with open (os .path .join (self .ttl_path , 'multi_array_reference.ttl' ), 'w' ) as sf :
51
+ sf .write (ttl )
48
52
with open (os .path .join (self .ttl_path , 'multi_array_reference.ttl' ), 'r' ) as sf :
49
53
expected_ttl = sf .read ()
50
54
self .assertEqual (expected_ttl , ttl )
0 commit comments