From 8ae2bf6d0688172c935159a60105e5060a8533cc Mon Sep 17 00:00:00 2001 From: jim Date: Wed, 3 Jun 2015 14:02:55 -0500 Subject: [PATCH] #42 added simple calculate_channel test --- tests/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/__init__.py b/tests/__init__.py index 6edf425..f24514a 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -88,6 +88,11 @@ class TestNd2Parser(unittest.TestCase): for i in range(50, 60): self.assertEqual(Nd2Parser._calculate_field_of_view(nd2, i), 2) + def test_calculate_channel_simple(self): + nd2 = MockNd2Parser(['GFP'], [0], [0]) + for i in range(1000): + self.assertEqual(Nd2Parser._calculate_channel(nd2, i), 'GFP') + def test_calculate_channel(self): nd2 = MockNd2Parser(['', 'GFP', 'dsRed', 'dTomato', 'lulzBlue', 'jimbotronPurple', 'orange'], [0], [0]) for i in range(1000): @@ -104,4 +109,5 @@ class TestNd2Parser(unittest.TestCase): nd2 = MockNd2Parser(['', 'GFP', 'dsRed', 'dTomato', 'lulzBlue', 'jimbotronPurple', 'orange'], list(range(31)), list(range(17))) for i in range(1000): for n, channel in enumerate(['', 'GFP', 'dsRed', 'dTomato', 'lulzBlue', 'jimbotronPurple', 'orange'], start=i*7): - self.assertEqual(Nd2Parser._calculate_channel(nd2, n), channel) \ No newline at end of file + self.assertEqual(Nd2Parser._calculate_channel(nd2, n), channel) +