Browse Source

Add test for raw metadata storage

zolfa-add_slices_loading
Ruben Verweij 8 years ago
parent
commit
d2a5d96f14
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      tests/test_raw_metadata.py

+ 7
- 0
tests/test_raw_metadata.py View File

@ -6,6 +6,7 @@ from nd2reader.raw_metadata import RawMetadata
class TestRawMetadata(unittest.TestCase): class TestRawMetadata(unittest.TestCase):
def setUp(self): def setUp(self):
self.raw_text, self.locations = ArtificialND2.create_label_map_bytes() self.raw_text, self.locations = ArtificialND2.create_label_map_bytes()
self.label_map = LabelMap(self.raw_text) self.label_map = LabelMap(self.raw_text)
@ -32,3 +33,9 @@ class TestRawMetadata(unittest.TestCase):
"channels", "pixel_microns"] "channels", "pixel_microns"]
for required in required_keys: for required in required_keys:
self.assertTrue(required in metadata) self.assertTrue(required in metadata)
# it should now be stored, see if that dict is returned
metadata['height'] = 1
self.metadata._metadata_parsed['height'] = 1
second_metadata = self.metadata.get_parsed_metadata()
self.assertDictEqual(metadata, second_metadata)

Loading…
Cancel
Save