From 03d20d3b6a2894a9053512b7b2d2c382bffd9a59 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Wed, 12 Nov 2014 22:45:35 -0800 Subject: [PATCH] More tests for ico save --- Tests/test_file_ico.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tests/test_file_ico.py b/Tests/test_file_ico.py index 200b6ba56..01d3f5904 100644 --- a/Tests/test_file_ico.py +++ b/Tests/test_file_ico.py @@ -22,13 +22,27 @@ class TestFileIco(PillowTestCase): im = hopper() im.save(output, "ico", sizes=[(32, 32), (64, 64)]) + # the default image output.seek(0) reloaded = Image.open(output) + self.assertEqual(reloaded.info['sizes'],set([(32, 32), (64, 64)])) self.assertEqual(im.mode, reloaded.mode) self.assertEqual((64, 64), reloaded.size) self.assertEqual(reloaded.format, "ICO") + self.assert_image_equal(reloaded, hopper().resize((64,64), Image.ANTIALIAS)) + # the other one + output.seek(0) + reloaded = Image.open(output) + reloaded.size = (32,32) + + self.assertEqual(im.mode, reloaded.mode) + self.assertEqual((32, 32), reloaded.size) + self.assertEqual(reloaded.format, "ICO") + self.assert_image_equal(reloaded, hopper().resize((32,32), Image.ANTIALIAS)) + + if __name__ == '__main__': unittest.main()