From 3ece8689bf11170e490856ee09b576abef1e3022 Mon Sep 17 00:00:00 2001 From: Ruben Verweij Date: Wed, 15 Mar 2017 13:36:47 +0100 Subject: [PATCH] Remove functional test for now, cannot store large nd2 files on github --- tests/test_legacy.py | 44 -------------------------------------------- tests/test_reader.py | 39 --------------------------------------- 2 files changed, 83 deletions(-) delete mode 100644 tests/test_legacy.py diff --git a/tests/test_legacy.py b/tests/test_legacy.py deleted file mode 100644 index 67f15e8..0000000 --- a/tests/test_legacy.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -Unit test for backwards compatibility. -""" -import unittest -from os import path - -from nd2reader.legacy import Nd2 - - -class TestReader(unittest.TestCase): - def setUp(self): - dir_path = path.dirname(path.realpath(__file__)) - self.files = [ - path.join(dir_path, 'test_data/data001.nd2'), - path.join(dir_path, 'test_data/data002.nd2') - ] - - def test_sizes_data_001(self): - with Nd2(self.files[0]) as reader: - self.assertEqual(reader.width, 128) - self.assertEqual(reader.height, 128) - self.assertEqual(len(reader.frames), 982) - self.assertEqual(len(reader.channels), 1) - self.assertEqual(len(reader.z_levels), 1) - - def test_frame_size_data_001(self): - with Nd2(self.files[0]) as reader: - frame = reader[13] - self.assertEqual(frame.shape[0], 128) - self.assertEqual(frame.shape[1], 128) - - def test_sizes_data_002(self): - with Nd2(self.files[1]) as reader: - self.assertEqual(reader.width, 512) - self.assertEqual(reader.height, 256) - self.assertEqual(len(reader.frames), 78) - self.assertEqual(len(reader.channels), 1) - self.assertEqual(len(reader.z_levels), 1) - - def test_frame_size_data_002(self): - with Nd2(self.files[1]) as reader: - frame = reader[13] - self.assertEqual(frame.shape[1], 512) - self.assertEqual(frame.shape[0], 256) diff --git a/tests/test_reader.py b/tests/test_reader.py index 66f0b1b..e183096 100644 --- a/tests/test_reader.py +++ b/tests/test_reader.py @@ -1,47 +1,8 @@ import unittest -from os import path from nd2reader.reader import ND2Reader class TestReader(unittest.TestCase): - - def setUp(self): - dir_path = path.dirname(path.realpath(__file__)) - self.files = [ - path.join(dir_path, 'test_data/data001.nd2'), - path.join(dir_path, 'test_data/data002.nd2') - ] - def test_extension(self): self.assertTrue('nd2' in ND2Reader.class_exts()) - - def test_sizes_data_001(self): - with ND2Reader(self.files[0]) as reader: - self.assertEqual(reader.sizes['x'], 128) - self.assertEqual(reader.sizes['y'], 128) - self.assertEqual(reader.sizes['t'], 982) - self.assertEqual(reader.sizes['c'], 1) - self.assertEqual(reader.sizes['z'], 1) - - def test_frame_size_data_001(self): - with ND2Reader(self.files[0]) as reader: - frame = reader[13] - self.assertEqual(frame.shape[0], 128) - self.assertEqual(frame.shape[1], 128) - - def test_sizes_data_002(self): - with ND2Reader(self.files[1]) as reader: - self.assertEqual(reader.sizes['x'], 512) - self.assertEqual(reader.sizes['y'], 256) - self.assertEqual(reader.sizes['t'], 78) - self.assertEqual(reader.sizes['c'], 1) - self.assertEqual(reader.sizes['z'], 1) - - def test_frame_size_data_002(self): - with ND2Reader(self.files[1]) as reader: - frame = reader[13] - self.assertEqual(frame.shape[1], 512) - self.assertEqual(frame.shape[0], 256) - -