Skip to content
test_flip_image.py 466 B
Newer Older
BO ZHANG's avatar
BO ZHANG committed
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):
BO ZHANG's avatar
BO ZHANG committed
        """ test flip image """
BO ZHANG's avatar
BO ZHANG committed
        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]))