mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-11-01 16:37:32 +03:00
Assert getpalette does not return None
This commit is contained in:
parent
755ebb8307
commit
a66d0d1f05
|
|
@ -62,6 +62,7 @@ def test_putpalette_with_alpha_values() -> None:
|
|||
expected = im.convert("RGBA")
|
||||
|
||||
palette = im.getpalette()
|
||||
assert palette is not None
|
||||
transparency = im.info.pop("transparency")
|
||||
|
||||
palette_with_alpha_values = []
|
||||
|
|
|
|||
|
|
@ -76,9 +76,14 @@ def test_consecutive() -> None:
|
|||
def test_palette_mmap() -> None:
|
||||
# Using mmap in ImageFile can require to reload the palette.
|
||||
with Image.open("Tests/images/multipage-mmap.tiff") as im:
|
||||
color1 = im.getpalette()[:3]
|
||||
palette = im.getpalette()
|
||||
assert palette is not None
|
||||
color1 = palette[:3]
|
||||
im.seek(0)
|
||||
color2 = im.getpalette()[:3]
|
||||
|
||||
palette = im.getpalette()
|
||||
assert palette is not None
|
||||
color2 = palette[:3]
|
||||
assert color1 == color2
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user