File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ from io import BytesIO
4+
35from PIL import WalImageFile
46
57from .helper import assert_image_equal_tofile
@@ -13,12 +15,22 @@ def test_open() -> None:
1315 assert im .format_description == "Quake2 Texture"
1416 assert im .mode == "P"
1517 assert im .size == (128 , 128 )
18+ assert "next_name" not in im .info
1619
1720 assert isinstance (im , WalImageFile .WalImageFile )
1821
1922 assert_image_equal_tofile (im , "Tests/images/hopper_wal.png" )
2023
2124
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+
2234def test_load () -> None :
2335 with WalImageFile .open (TEST_FILE ) as im :
2436 px = im .load ()
You can’t perform that action at this time.
0 commit comments