mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-13 08:44:45 +03:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
376c4f829f
commit
f64abb3403
|
@ -99,18 +99,27 @@ class TestFilePng:
|
||||||
if mode == "I;16":
|
if mode == "I;16":
|
||||||
reloaded = reloaded.convert(mode)
|
reloaded = reloaded.convert(mode)
|
||||||
assert_image_equal(reloaded, im)
|
assert_image_equal(reloaded, im)
|
||||||
|
|
||||||
def test_putpalette(self):
|
def test_putpalette(self):
|
||||||
valid_file = "Tests/images/FudanPed00003_mask.png"
|
valid_file = "Tests/images/FudanPed00003_mask.png"
|
||||||
with pytest.raises(ValueError) as err:
|
with pytest.raises(ValueError) as err:
|
||||||
mask = Image.open(valid_file)
|
mask = Image.open(valid_file)
|
||||||
mask.putpalette([
|
mask.putpalette(
|
||||||
0, 0, 0, # black background
|
[
|
||||||
255, 0, 0, # index 1 is red
|
0,
|
||||||
255, 255, 0, # index 2 is yellow
|
0,
|
||||||
255, 153, 0, # index 3 is orange
|
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):
|
def test_invalid_file(self):
|
||||||
invalid_file = "Tests/images/flower.jpg"
|
invalid_file = "Tests/images/flower.jpg"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user