Browse Source

Expand tests

zolfa-add_slices_loading
Ruben Verweij 6 years ago
parent
commit
593c976459
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      tests/test_raw_metadata.py

+ 6
- 1
tests/test_raw_metadata.py View File

@ -4,7 +4,7 @@ import six
from nd2reader.artificial import ArtificialND2 from nd2reader.artificial import ArtificialND2
from nd2reader.label_map import LabelMap from nd2reader.label_map import LabelMap
from nd2reader.raw_metadata import RawMetadata from nd2reader.raw_metadata import RawMetadata
from nd2reader.common_raw_metadata import parse_roi_shape, parse_roi_type
from nd2reader.common_raw_metadata import parse_roi_shape, parse_roi_type, parse_dimension_text_line
class TestRawMetadata(unittest.TestCase): class TestRawMetadata(unittest.TestCase):
@ -25,6 +25,11 @@ class TestRawMetadata(unittest.TestCase):
self.assertEqual(parse_roi_type(4), 'stimulation') self.assertEqual(parse_roi_type(4), 'stimulation')
self.assertIsNone(parse_roi_type(-1)) self.assertIsNone(parse_roi_type(-1))
def test_parse_dimension_text(self):
line = six.b('Metadata:\r\nDimensions: T(443) x \xce\xbb(1)\r\nCamera Name: Andor Zyla VSC-01537')
self.assertEqual(parse_dimension_text_line(line), six.b('Dimensions: T(443) x \xce\xbb(1)'))
self.assertIsNone(parse_dimension_text_line(six.b('Dim: nothing')))
def test_dict(self): def test_dict(self):
self.assertTrue(type(self.metadata.__dict__) is dict) self.assertTrue(type(self.metadata.__dict__) is dict)


Loading…
Cancel
Save