Browse Source

added some functional tests

zolfa-add_slices_loading
jim 8 years ago
parent
commit
b9ee52270e
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      functional_tests/FYLM141111001.py

+ 11
- 0
functional_tests/FYLM141111001.py View File

@ -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)

Loading…
Cancel
Save