From b9ee52270e4f5fdf9e750c767585af907bafbfee Mon Sep 17 00:00:00 2001 From: jim Date: Mon, 15 Feb 2016 18:02:38 -0600 Subject: [PATCH] added some functional tests --- functional_tests/FYLM141111001.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/functional_tests/FYLM141111001.py b/functional_tests/FYLM141111001.py index e48c21a..9eaad52 100644 --- a/functional_tests/FYLM141111001.py +++ b/functional_tests/FYLM141111001.py @@ -216,3 +216,14 @@ class FYLM141111Tests(unittest.TestCase): def test_pixel_microns(self): self.assertEqual(round(self.nd2.pixel_microns, 2), 0.22) + + def test_numpy_operations(self): + # just to make sure we can do this kind of thing and get scalars + self.assertTrue(0 < np.mean(self.nd2[0]) < np.sum(self.nd2[0])) + + def test_numpy_mean(self): + # make sure we get the right value and type + expected_mean = 17513.053581054686 + mean = np.mean(self.nd2[0]) + self.assertEqual(type(mean), np.float64) + self.assertAlmostEqual(expected_mean, mean)