py3k: Add Windows icon sanity test

This commit is contained in:
Brian Crowell 2012-10-25 17:00:19 -05:00 committed by Brian Crowell
parent 276cc421f7
commit 848579af9b
3 changed files with 15 additions and 1 deletions

BIN
Images/lena.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -49,7 +49,7 @@ class IcoImageFile(BmpImagePlugin.BmpImageFile):
raise SyntaxError("not an ICO file")
# pick the largest icon in the file
m = ""
m = b""
for i in range(i16(s[4:])):
s = self.fp.read(16)
if not m:

14
Tests/test_file_ico.py Normal file
View File

@ -0,0 +1,14 @@
from tester import *
from PIL import Image
# sample ppm stream
file = "Images/lena.ico"
data = open(file, "rb").read()
def test_sanity():
im = Image.open(file)
im.load()
assert_equal(im.mode, "P")
assert_equal(im.size, (16, 16))
assert_equal(im.format, "ICO")