mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 00:46:16 +03:00
Basic WAL test
This commit is contained in:
parent
8674f71907
commit
a852c6186f
23
Tests/test_file_wal.py
Normal file
23
Tests/test_file_wal.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
from helper import unittest, PillowTestCase
|
||||
|
||||
from PIL import WalImageFile
|
||||
|
||||
|
||||
class TestFileWal(PillowTestCase):
|
||||
|
||||
def test_open(self):
|
||||
# Arrange
|
||||
TEST_FILE = "Tests/images/hopper.wal"
|
||||
|
||||
# Act
|
||||
im = WalImageFile.open(TEST_FILE)
|
||||
|
||||
# Assert
|
||||
self.assertEqual(im.format, "WAL")
|
||||
self.assertEqual(im.format_description, "Quake2 Texture")
|
||||
self.assertEqual(im.mode, "P")
|
||||
self.assertEqual(im.size, (128, 128))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
|
@ -74,6 +74,7 @@ def open(filename):
|
|||
with builtins.open(filename, "rb") as fp:
|
||||
return imopen(fp)
|
||||
|
||||
|
||||
quake2palette = (
|
||||
# default palette taken from piffo 0.93 by Hans Häggström
|
||||
b"\x01\x01\x01\x0b\x0b\x0b\x12\x12\x12\x17\x17\x17\x1b\x1b\x1b\x1e"
|
||||
|
|
Loading…
Reference in New Issue
Block a user