mirror of
https://github.com/python-pillow/Pillow.git
synced 2026-01-11 11:11:17 +03:00
Test drawing a new color onto a dirty palette
This commit is contained in:
parent
6a9960e8c1
commit
d06c8b3591
|
|
@ -68,10 +68,20 @@ def test_sanity() -> None:
|
|||
draw.rectangle(list(range(4)))
|
||||
|
||||
|
||||
def test_valueerror() -> None:
|
||||
def test_new_color() -> None:
|
||||
with Image.open("Tests/images/chi.gif") as im:
|
||||
draw = ImageDraw.Draw(im)
|
||||
assert len(im.palette.colors) == 249
|
||||
|
||||
# Test drawing a new color onto the palette
|
||||
draw.line((0, 0), fill=(0, 0, 0))
|
||||
assert len(im.palette.colors) == 250
|
||||
assert im.palette.dirty
|
||||
|
||||
# Test drawing another new color, now that the palette is dirty
|
||||
draw.point((0, 0), fill=(1, 0, 0))
|
||||
assert len(im.palette.colors) == 251
|
||||
assert im.convert("RGB").getpixel((0, 0)) == (1, 0, 0)
|
||||
|
||||
|
||||
def test_mode_mismatch() -> None:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user