Added tests

This commit is contained in:
Andrew Murray 2018-09-30 14:47:05 +10:00
parent 6f44ae1d27
commit e3675f95fb
2 changed files with 9 additions and 0 deletions

View File

@ -64,6 +64,10 @@ class TestFileIcns(PillowTestCase):
self.assertEqual(im2.mode, 'RGBA')
self.assertEqual(im2.size, (wr, hr))
# Check that we cannot load an incorrect size
with self.assertRaises(ValueError):
im.size = (1, 1)
def test_older_icon(self):
# This icon was made with Icon Composer rather than iconutil; it still
# uses PNG rather than JP2, however (since it was made on 10.9).

View File

@ -47,6 +47,11 @@ class TestFileIco(PillowTestCase):
self.assert_image_equal(reloaded,
hopper().resize((32, 32), Image.LANCZOS))
def test_incorrect_size(self):
im = Image.open(TEST_ICO_FILE)
with self.assertRaises(ValueError):
im.size = (1, 1)
def test_save_256x256(self):
"""Issue #2264 https://github.com/python-pillow/Pillow/issues/2264"""
# Arrange