Skip to content

Commit

Permalink
feat(dims): cover image dimension tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnec committed Dec 22, 2020
1 parent bb2b63d commit 646acbf
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,34 @@ def test_batch_process(self):
# assertion
self.assertEqual(True, ret)

@idata((
[np.ones([5, 5, 3, 1]), np.ones([5, 5, 3, 1]), False],
[np.ones([5, 5, 3]), np.ones([5, 5, 3]), True],
[np.ones([5, 5, 3]), np.ones([9, 9, 3]), True],
[np.ones([5, 5, 3]), np.ones([2, 2, 3]), True],
[np.ones([5, 5, 1]), np.ones([5, 5, 1]), False],
[np.ones([5, 5, 2]), np.ones([5, 5, 2]), False],
[np.ones([5, 5, 3]), np.ones([5, 5, 1]), False],
[np.ones([5, 5, 1]), np.ones([5, 5, 3]), False],
[np.ones([5, 5]), np.ones([5, 5]), False],
[np.ones([5]), np.ones([5]), False],
[np.ones([1]), np.ones([1]), False],
[np.ones([0]), np.ones([0]), False],
[None, None, False]
))
@unpack
def test_img_dims(self, src_img, img_ref, exp_val):

try:
obj = ColorMatcher(src=src_img, ref=img_ref)
res = obj.main()
ret = res.mean().astype('bool')
msg = ''
except BaseException as e:
ret = False
msg = e

self.assertEqual(exp_val, ret, msg=msg)

if __name__ == '__main__':
unittest.main()

0 comments on commit 646acbf

Please sign in to comment.