From fb1d25417ec67e0850dd13b204b802d689604bbe Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 11 Apr 2018 20:55:35 +0300 Subject: [PATCH] test for wrong channels number in generate --- Tests/test_color_lut.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/test_color_lut.py b/Tests/test_color_lut.py index 9de2cf245..505f4229a 100644 --- a/Tests/test_color_lut.py +++ b/Tests/test_color_lut.py @@ -269,6 +269,10 @@ class TestColorLut3DFilter(PillowTestCase): class TestGenerateColorLut3D(PillowTestCase): def test_wrong_channels_count(self): + with self.assertRaisesRegexp(ValueError, "3 or 4 output channels"): + ImageFilter.Color3DLUT.generate(5, channels=2, + callback=lambda r, g, b: (r, g, b)) + with self.assertRaisesRegexp(ValueError, "should have either channels"): ImageFilter.Color3DLUT.generate(5, lambda r, g, b: (r, g, b, r))