Skip to content

Commit b433b82

Browse files
committed
fix
1 parent 6a9960e commit b433b82

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Tests/test_imagedraw.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,19 @@ def test_sanity() -> None:
6868
draw.rectangle(list(range(4)))
6969

7070

71-
def test_valueerror() -> None:
71+
def test_new_color() -> None:
7272
with Image.open("Tests/images/chi.gif") as im:
7373
draw = ImageDraw.Draw(im)
74+
assert len(im.palette.colors) == 249
75+
76+
# Test drawing a new color onto the palette
7477
draw.line((0, 0), fill=(0, 0, 0))
78+
assert len(im.palette.colors) == 250
79+
assert im.palette.dirty
80+
81+
# Test drawing another new color, now that the palette is dirty
82+
draw.line((0, 0), fill=(1, 0, 0))
83+
assert len(im.palette.colors) == 251
7584

7685

7786
def test_mode_mismatch() -> None:

0 commit comments

Comments
 (0)