Added tests

This commit is contained in:
Andrew Murray 2018-08-25 08:56:41 +10:00
parent 1e56ed8c00
commit 0a1fae8c2d

View File

@ -94,6 +94,15 @@ class TestImageFilter(PillowTestCase):
self.assertEqual(rankfilter.size, 1)
self.assertEqual(rankfilter.rank, 2)
def test_kernel_not_enough_coefficients(self):
self.assertRaises(ValueError,
lambda: ImageFilter.Kernel((3, 3), (0, 0)))
def test_kernel_filter_p(self):
kernel = ImageFilter.Kernel((2, 2), (0, 0, 0, 0))
self.assertRaises(ValueError, kernel.filter, hopper("P"))
def test_consistency_3x3(self):
source = Image.open("Tests/images/hopper.bmp")
reference = Image.open("Tests/images/hopper_emboss.bmp")