File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import annotations
2
2
3
+ from io import BytesIO
4
+
3
5
from PIL import WalImageFile
4
6
5
7
from .helper import assert_image_equal_tofile
@@ -13,12 +15,22 @@ def test_open() -> None:
13
15
assert im .format_description == "Quake2 Texture"
14
16
assert im .mode == "P"
15
17
assert im .size == (128 , 128 )
18
+ assert "next_name" not in im .info
16
19
17
20
assert isinstance (im , WalImageFile .WalImageFile )
18
21
19
22
assert_image_equal_tofile (im , "Tests/images/hopper_wal.png" )
20
23
21
24
25
+ def test_next_name () -> None :
26
+ with open (TEST_FILE , "rb" ) as fp :
27
+ data = bytearray (fp .read ())
28
+ data [56 :60 ] = b"Test"
29
+ f = BytesIO (data )
30
+ with WalImageFile .open (f ) as im :
31
+ assert im .info ["next_name" ] == b"Test"
32
+
33
+
22
34
def test_load () -> None :
23
35
with WalImageFile .open (TEST_FILE ) as im :
24
36
px = im .load ()
You can’t perform that action at this time.
0 commit comments