Updated tests in light of #6060

This commit is contained in:
Andrew Murray 2022-02-20 23:54:12 +11:00
parent 7aa49741c6
commit 11948050ae

View File

@ -27,22 +27,18 @@ def test_palette_rawmode():
for rawmode in ("RGB", None): for rawmode in ("RGB", None):
rgb = im.getpalette(rawmode) rgb = im.getpalette(rawmode)
assert len(rgb) == 256 * 3 assert rgb == [1, 2, 3]
assert rgb[:3] == [1, 2, 3]
# Convert the RGB palette to RGBA # Convert the RGB palette to RGBA
rgba = im.getpalette("RGBA") rgba = im.getpalette("RGBA")
assert len(rgba) == 256 * 4 assert rgba == [1, 2, 3, 255]
assert rgba[:4] == [1, 2, 3, 255]
im.putpalette((1, 2, 3, 4), "RGBA") im.putpalette((1, 2, 3, 4), "RGBA")
# Convert the RGBA palette to RGB # Convert the RGBA palette to RGB
rgb = im.getpalette("RGB") rgb = im.getpalette("RGB")
assert len(rgb) == 256 * 3 assert rgb == [1, 2, 3]
assert rgb[:3] == [1, 2, 3]
for rawmode in ("RGBA", None): for rawmode in ("RGBA", None):
rgba = im.getpalette(rawmode) rgba = im.getpalette(rawmode)
assert len(rgba) == 256 * 4 assert rgba == [1, 2, 3, 4]
assert rgba[:4] == [1, 2, 3, 4]