non-animated png sanity tests

This commit is contained in:
Peter Rowlands 2020-04-03 20:51:29 +09:00
parent dc56c6064f
commit 2e6adc5793

View File

@ -85,6 +85,8 @@ class TestFilePng:
assert im.size == (128, 128) assert im.size == (128, 128)
assert im.format == "PNG" assert im.format == "PNG"
assert im.get_format_mimetype() == "image/png" assert im.get_format_mimetype() == "image/png"
assert im.n_frames == 1
assert not im.is_animated
for mode in ["1", "L", "P", "RGB", "I", "I;16"]: for mode in ["1", "L", "P", "RGB", "I", "I;16"]:
im = hopper(mode) im = hopper(mode)
@ -635,7 +637,6 @@ class TestFilePng:
def test_seek(self): def test_seek(self):
with Image.open(TEST_PNG_FILE) as im: with Image.open(TEST_PNG_FILE) as im:
assert im.n_frames == 1
im.seek(0) im.seek(0)
with pytest.raises(EOFError): with pytest.raises(EOFError):
im.seek(1) im.seek(1)