Merge pull request #2989 from hugovk/test-wal

Test WalImageFile
This commit is contained in:
Hugo 2018-07-01 09:34:15 +03:00 committed by GitHub
commit 597f067796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

BIN
Tests/images/hopper.wal Normal file

Binary file not shown.

23
Tests/test_file_wal.py Normal file
View 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()