You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
652 B

  1. from nd2reader.parser import Nd2Parser
  2. import unittest
  3. class MockNd2Parser(object):
  4. def __init__(self, channels, fields_of_view, z_levels):
  5. self.channels = channels
  6. self.fields_of_view = fields_of_view
  7. self.z_levels = z_levels
  8. class TestNd2Parser(unittest.TestCase):
  9. def test_calculate_field_of_view_simple(self):
  10. """ With a single field of view, the field of view should always be the same number (0). """
  11. nd2 = MockNd2Parser([''], [0], [0])
  12. for frame_number in range(1000):
  13. result = Nd2Parser._calculate_field_of_view(nd2, frame_number)
  14. self.assertEqual(result, 0)