Added test for invalid image

This commit is contained in:
Andrew Murray 2015-06-09 14:36:34 +10:00
parent 4c02ae4061
commit 1ee1860b52

View File

@ -30,6 +30,15 @@ class TestImage(PillowTestCase):
# self.assertRaises(
# MemoryError, lambda: Image.new("L", (1000000, 1000000)))
def test_invalid_image(self):
if str is bytes:
import StringIO
im = StringIO.StringIO('')
else:
import io
im = io.BytesIO(b'')
self.assertRaises(IOError, lambda: Image.open(im))
def test_internals(self):
im = Image.new("L", (100, 100))