Commit e9a2ede9 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

added unit test

parent 89919a4f
import unittest
import numpy as np
from csst_proto.top_level_interface import flip_image, read_test_image
class FlipImageTestCase(unittest.TestCase):
def test_flip_image(self):
# flip test image
self.assertTrue(
np.all(flip_image(read_test_image()) == np.array([[4, 3], [2, 1]]))
)
# the code fails for 1D array
with self.assertRaises(AssertionError):
flip_image(np.array([1, 2, 3, 4]))
if __name__ == "__main__":
unittest.main()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment