diff --git a/Tests/test_image_filter.py b/Tests/test_image_filter.py index 3636a73f7..75665d20a 100644 --- a/Tests/test_image_filter.py +++ b/Tests/test_image_filter.py @@ -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")