Skip to content

Commit

Permalink
WIP: add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Nov 14, 2023
1 parent dd60abb commit 0267566
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Tests/test_file_cur.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ def test_invalid_file():

with pytest.raises(SyntaxError, match="No images were found"):
CurImagePlugin.CurImageFile("Tests/images/no_cursors.cur")


def test_1bit_transparency():
with Image.open("Tests/images/cur_259.cur") as im:
assert im.size == (32, 32) and im.mode == "RGBA"
assert im.getpixel((0, 0)) == (0, 0, 0, 255) # pointy bit is black
assert im.getpixel((1, 0)) == (0, 0, 0, 255) # and its neighbor is black
assert im.getpixel((2, 0)) == (0, 0, 0, 0) # third pixel in the upper row is transparent though
assert im.getpixel((1, 1)) == (255, 255, 255, 255) # cursor body is white

0 comments on commit 0267566

Please sign in to comment.