Pillow/Tests/test_file_wal.py

22 lines
511 B
Python
Raw Normal View History

2018-01-29 18:18:06 +03:00
from PIL import WalImageFile
2021-07-18 05:35:27 +03:00
from .helper import assert_image_equal_tofile
def test_open():
# Arrange
TEST_FILE = "Tests/images/hopper.wal"
2018-01-29 18:18:06 +03:00
# Act
2021-07-18 05:35:27 +03:00
with WalImageFile.open(TEST_FILE) as im:
# Assert
assert im.format == "WAL"
assert im.format_description == "Quake2 Texture"
assert im.mode == "P"
assert im.size == (128, 128)
assert isinstance(im, WalImageFile.WalImageFile)
2018-01-29 18:18:06 +03:00
2021-07-18 05:35:27 +03:00
assert_image_equal_tofile(im, "Tests/images/hopper_wal.png")