From 1ee1860b52be3aa9877255854ad3f84ca834df06 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 9 Jun 2015 14:36:34 +1000 Subject: [PATCH] Added test for invalid image --- Tests/test_image.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Tests/test_image.py b/Tests/test_image.py index caee70fec..469045909 100644 --- a/Tests/test_image.py +++ b/Tests/test_image.py @@ -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))