Skip to content

Commit 33460d2

Browse files
committed
Assert _getmp() does not return None
1 parent 0d1edba commit 33460d2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Tests/test_file_mpo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def test_reload_exif_after_seek() -> None:
156156
def test_mp(test_file: str) -> None:
157157
with Image.open(test_file) as im:
158158
mpinfo = im._getmp()
159+
assert mpinfo is not None
159160
assert mpinfo[45056] == b"0100"
160161
assert mpinfo[45057] == 2
161162

@@ -165,6 +166,7 @@ def test_mp_offset() -> None:
165166
# in APP2 data, in contrast to normal 8
166167
with Image.open("Tests/images/sugarshack_ifd_offset.mpo") as im:
167168
mpinfo = im._getmp()
169+
assert mpinfo is not None
168170
assert mpinfo[45056] == b"0100"
169171
assert mpinfo[45057] == 2
170172

@@ -181,6 +183,7 @@ def test_mp_no_data() -> None:
181183
def test_mp_attribute(test_file: str) -> None:
182184
with Image.open(test_file) as im:
183185
mpinfo = im._getmp()
186+
assert mpinfo is not None
184187
for frame_number, mpentry in enumerate(mpinfo[0xB002]):
185188
mpattr = mpentry["Attribute"]
186189
if frame_number:

0 commit comments

Comments
 (0)