From d2a5d96f1439b7ddfd446102cba66504102c13e6 Mon Sep 17 00:00:00 2001 From: Ruben Verweij Date: Thu, 30 Mar 2017 15:43:23 +0200 Subject: [PATCH] Add test for raw metadata storage --- tests/test_raw_metadata.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_raw_metadata.py b/tests/test_raw_metadata.py index ef9972a..635341b 100644 --- a/tests/test_raw_metadata.py +++ b/tests/test_raw_metadata.py @@ -6,6 +6,7 @@ from nd2reader.raw_metadata import RawMetadata class TestRawMetadata(unittest.TestCase): + def setUp(self): self.raw_text, self.locations = ArtificialND2.create_label_map_bytes() self.label_map = LabelMap(self.raw_text) @@ -32,3 +33,9 @@ class TestRawMetadata(unittest.TestCase): "channels", "pixel_microns"] for required in required_keys: 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)