Exemplo n.º 1
0
    def test_wrong_init_parameters(self):
        with self.assertRaises(ValueError):
            RotateFilter(**{})

        with self.assertRaises(ValueError):
            RotateFilter(**{'angle': 'string'})

        with self.assertRaises(ValueError):
            RotateFilter(**{'angle': []})
Exemplo n.º 2
0
    def test_rotate_180(self):
        rotate_filter = RotateFilter(**{'angle': 180})

        image_png = copy(self.image_png)
        image_png = rotate_filter.apply(image_png)
        self.assertTupleEqual((1001, 501), image_png.size)

        image_jpg = copy(self.image_jpg)
        image_jpg = rotate_filter.apply(image_jpg)
        self.assertTupleEqual((1001, 501), image_jpg.size)

        image_tif = copy(self.image_tif)
        image_tif = rotate_filter.apply(image_tif)
        self.assertTupleEqual((1001, 501), image_tif.size)

        image_bmp = copy(self.image_bmp)
        image_bmp = rotate_filter.apply(image_bmp)
        self.assertTupleEqual((1001, 501), image_bmp.size)
Exemplo n.º 3
0
 def test_wrong_resource_type(self):
     rotate_filter = RotateFilter(**{'angle': 0})
     with self.assertRaises(ValueError):
         rotate_filter.apply('string')