Skip to content

Commit

Permalink
Updated tests in light of #6060
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 20, 2022
1 parent 7aa4974 commit 1194805
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Tests/test_image_getpalette.py
Expand Up @@ -27,22 +27,18 @@ def test_palette_rawmode():

for rawmode in ("RGB", None):
rgb = im.getpalette(rawmode)
assert len(rgb) == 256 * 3
assert rgb[:3] == [1, 2, 3]
assert rgb == [1, 2, 3]

# Convert the RGB palette to RGBA
rgba = im.getpalette("RGBA")
assert len(rgba) == 256 * 4
assert rgba[:4] == [1, 2, 3, 255]
assert rgba == [1, 2, 3, 255]

im.putpalette((1, 2, 3, 4), "RGBA")

# Convert the RGBA palette to RGB
rgb = im.getpalette("RGB")
assert len(rgb) == 256 * 3
assert rgb[:3] == [1, 2, 3]
assert rgb == [1, 2, 3]

for rawmode in ("RGBA", None):
rgba = im.getpalette(rawmode)
assert len(rgba) == 256 * 4
assert rgba[:4] == [1, 2, 3, 4]
assert rgba == [1, 2, 3, 4]

0 comments on commit 1194805

Please sign in to comment.