55
66import numpy as np
77from pybdv import make_bdv
8- from pybdv .util import open_file
9-
10- try :
11- import z5py
12- except ImportError :
13- z5py = None
14-
8+ from pybdv .util import n5_file
159
1610
1711class MetadataTestMixin (ABC ):
@@ -69,12 +63,12 @@ def test_validate_attributes(self):
6963
7064 attrs2 = {'channel' : {'id' : None , 'name' : 'foo' }}
7165 attrs2_exp = {'channel' : {'id' : 0 , 'name' : 'foo' }}
72- attrs2_ = validate_attributes (self .xml_path , attrs1 , 0 , True )
66+ attrs2_ = validate_attributes (self .xml_path , attrs2 , 0 , True )
7367 self .assertEqual (attrs2_exp , attrs2_ )
7468
7569 attrs3 = {'channel' : {'name' : 'bar' }}
7670 with self .assertRaises (ValueError ):
77- validate_attributes (self .xml_path , attrs1 , 1 , True )
71+ validate_attributes (self .xml_path , attrs3 , 1 , True )
7872
7973 attrs4 = {'displaysettings' : {'id' : 0 , 'name' : 'baz' , 'min' : 0 , 'max' : 1 , 'isset' : True ,
8074 'color' : [255 , 255 , 255 , 255 ]}}
@@ -96,7 +90,7 @@ class TestMetadataH5(MetadataTestMixin, unittest.TestCase):
9690 bdv_format = 'bdv.hdf5'
9791
9892
99- @unittest .skipUnless ( z5py is not None , "Need z5py for n5 support" )
93+ @unittest .skipIf ( n5_file is None , "Need zarr or z5py for n5 support" )
10094class TestMetadataN5 (MetadataTestMixin , unittest .TestCase ):
10195 out_path = './tmp/test.n5'
10296 out_path2 = './tmp/test2.n5'
0 commit comments