Merge pull request #8806 from radarhere/fli

Improved FliImagePlugin test coverage
This commit is contained in:
Hugo van Kemenade 2025-03-16 17:06:53 +02:00 committed by GitHub
commit 33ce0140fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 9 deletions

View File

@ -1,5 +1,6 @@
from __future__ import annotations
import io
import warnings
import pytest
@ -132,6 +133,15 @@ def test_eoferror() -> None:
im.seek(n_frames - 1)
def test_missing_frame_size() -> None:
with open(animated_test_file, "rb") as fp:
data = fp.read()
data = data[:6188]
with Image.open(io.BytesIO(data)) as im:
with pytest.raises(EOFError, match="missing frame size"):
im.seek(1)
def test_seek_tell() -> None:
with Image.open(animated_test_file) as im:
layer_number = im.tell()