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.

21 lines
621 B

  1. import unittest
  2. from os import path
  3. from nd2reader.artificial import ArtificialND2
  4. from nd2reader.parser import Parser
  5. class TestParser(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 open(self.test_file, 'rb') as fh:
  15. parser = Parser(fh)
  16. self.assertTrue(parser.supported)