This commit is contained in:
moghadas76 2023-05-26 07:58:05 +00:00 committed by GitHub
commit a6b178f676
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -100,6 +100,27 @@ class TestFilePng:
reloaded = reloaded.convert(mode)
assert_image_equal(reloaded, im)
def test_putpalette(self):
valid_file = "Tests/images/FudanPed00003_mask.png"
with pytest.raises(ValueError):
mask = Image.open(valid_file)
mask.putpalette(
[
0,
0,
0, # black background
255,
0,
0, # index 1 is red
255,
255,
0, # index 2 is yellow
255,
153,
0, # index 3 is orange
]
)
def test_invalid_file(self):
invalid_file = "Tests/images/flower.jpg"