Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
Add extra tests for non-None-ness in test_classes
Browse files Browse the repository at this point in the history
Some weird errors are happening in tests, where the image, or
image.pixels, is None. So, we assert that both are not None so that
tests fail rather than error out.

 Changes to be committed:
	modified:   tests/test_classes.py
  • Loading branch information
kdm9 committed Sep 21, 2014
1 parent 9294b8e commit 86e9b71
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,11 @@ def test_iter_by_files(self):
res = ts.iter_by_files()
self.assertTrue(isgenerator(res))
for iii, image in enumerate(res):
self.assertIsNot(image, None)
self.assertEqual(image.path, helpers.TS_FILES_JPG[iii])
self.assertEqual(image.datetime,
helpers.TS_DATES_PARSED[iii])
self.assertIsNot(image.pixels, None)
self.assertEqual(image.pixels.dtype, helpers.TS_JPG_DTYPE)
self.assertEqual(image.pixels.shape, helpers.TS_JPG_SHAPE)

Expand All @@ -255,10 +257,12 @@ def test_iter_by_timepoints_full(self):
self.assertTrue(isgenerator(res))
for iii, image in enumerate(res):
# Check lazy-loading
self.assertIsNot(image, None)
self.assertIsNone(image._pixels)
self.assertEqual(image.path, helpers.TS_FILES_JPG[iii])
self.assertEqual(image.datetime,
helpers.TS_DATES_PARSED[iii])
self.assertIsNot(image.pixels, None)
self.assertEqual(image.pixels.dtype, helpers.TS_JPG_DTYPE)
self.assertEqual(image.pixels.shape, helpers.TS_JPG_SHAPE)

Expand Down

0 comments on commit 86e9b71

Please sign in to comment.