Skip to content

Commit d23d51c

Browse files
committed
test iteration
1 parent 9328d2c commit d23d51c

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

lib/bald/tests/integration/TTL/ereefs_gbr4_ncld.ttl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ ns1:salt a bald:Array ;
7575
ns1:substanceOrTaxon_id <http://sweet.jpl.nasa.gov/2.2/matrWater.owl#SaltWater> ;
7676
ns1:unit_id <http://environment.data.gov.au/water/quality/def/unit/PSU> ;
7777
ns1:units "PSU" ;
78-
ns1:valid_range [ rdf:first 0.0 ;
79-
rdf:rest ( 40.0 ) ] ;
78+
ns1:valid_range ( 0.0 40.0 ) ;
8079
bald:references ns1:salt_time_ref ;
8180
bald:shape "(5, 47, 180, 600)" .
8281

@@ -92,8 +91,7 @@ ns1:temp a bald:Array ;
9291
ns1:substanceOrTaxon_id <http://sweet.jpl.nasa.gov/2.2/matrWater.owl#SaltWater> ;
9392
ns1:unit_id <http://qudt.org/vocab/unit#DegreeCelsius> ;
9493
ns1:units "degrees C" ;
95-
ns1:valid_range [ rdf:first 0.0 ;
96-
rdf:rest ( 40.0 ) ] ;
94+
ns1:valid_range ( 0.0 40.0 ) ;
9795
bald:references ns1:temp_time_ref ;
9896
bald:shape "(5, 47, 180, 600)" .
9997

lib/bald/tests/integration/test_multi_array_reference.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ def test_load(self):
2929
cdlfile = os.path.join(self.cdl_path, 'multi_array_reference.cdl')
3030
with self.temp_filename('.nc') as tfile:
3131
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))
3740

3841
def test_turtle(self):
3942
with self.temp_filename('.nc') as tfile:
@@ -43,8 +46,9 @@ def test_turtle(self):
4346
cdl_file_uri = 'file://CDL/{}'.format(cdlname)
4447
root_container = bald.load_netcdf(tfile, baseuri=cdl_file_uri, cache=self.acache)
4548
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)
4852
with open(os.path.join(self.ttl_path, 'multi_array_reference.ttl'), 'r') as sf:
4953
expected_ttl = sf.read()
5054
self.assertEqual(expected_ttl, ttl)

0 commit comments

Comments
 (0)