Test ImageCms.profileToProfile with invalid flags

This commit is contained in:
Hugo van Kemenade 2022-06-15 21:34:16 +03:00
parent b47bcc246f
commit 6c889d1088

View File

@ -210,6 +210,15 @@ def test_invalid_color_temperature():
ImageCms.createProfile("LAB", "invalid")
@pytest.mark.parametrize("flag", ("my string", -1))
def test_invalid_flag(flag):
with hopper() as im:
with pytest.raises(
ImageCms.PyCMSError, match="flags must be an integer between 0 and "
):
ImageCms.profileToProfile(im, "foo", "bar", flags=flag)
def test_simple_lab():
i = Image.new("RGB", (10, 10), (128, 128, 128))