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.

25 lines
791 B

  1. import unittest
  2. from os import path
  3. from nd2reader.artificial import ArtificialND2
  4. from nd2reader.legacy import Nd2
  5. class TestLegacy(unittest.TestCase):
  6. def create_test_nd2(self):
  7. with ArtificialND2(self.test_file) as artificial:
  8. artificial.close()
  9. def setUp(self):
  10. dir_path = path.dirname(path.realpath(__file__))
  11. self.test_file = path.join(dir_path, 'test_data/test.nd2')
  12. def test_can_open_test_file(self):
  13. self.create_test_nd2()
  14. with Nd2(self.test_file) as reader:
  15. self.assertEqual(reader.width, 0)
  16. self.assertEqual(reader.height, 0)
  17. self.assertEqual(len(reader.z_levels), 1)
  18. self.assertEqual(len(reader.channels), 0)
  19. self.assertEqual(len(reader.frames), 1)