From 75cb1c1b87ae4be028f3e15141c14c28dd0d04a0 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 21 Sep 2024 16:02:23 +1000 Subject: [PATCH] Test unsupported image mode --- Tests/test_file_webp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/test_file_webp.py b/Tests/test_file_webp.py index e7c887279..79f6bb4e0 100644 --- a/Tests/test_file_webp.py +++ b/Tests/test_file_webp.py @@ -127,6 +127,11 @@ class TestFileWebp: reloaded.seek(1) assert_image_similar(im2, reloaded, 1) + def test_unsupported_image_mode(self) -> None: + im = Image.new("1", (1, 1)) + with pytest.raises(ValueError): + _webp.WebPEncode(im.getim(), False, 0, 0, "", 4, 0, b"", "") + def test_icc_profile(self, tmp_path: Path) -> None: self._roundtrip(tmp_path, self.rgb_mode, 12.5, {"icc_profile": None}) self._roundtrip(