Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Apr 4, 2016
1 parent d07ab52 commit dabb68a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Tests/test_file_spider.py
@@ -1,6 +1,7 @@
from helper import unittest, PillowTestCase, hopper

from PIL import Image
from PIL import ImageSequence
from PIL import SpiderImagePlugin

TEST_FILE = "Tests/images/hopper.spider"
Expand Down Expand Up @@ -85,6 +86,17 @@ def test_invalid_file(self):

self.assertRaises(IOError, lambda: Image.open(invalid_file))

def test_nonstack_file(self):
im = Image.open(TEST_FILE)

self.assertRaises(EOFError, lambda: im.seek(0))

def test_nonstack_dos(self):
im = Image.open(TEST_FILE)
for i, frame in enumerate(ImageSequence.Iterator(im)):
if i > 1:
self.fail("Non-stack DOS file test failed")


if __name__ == '__main__':
unittest.main()
Expand Down

0 comments on commit dabb68a

Please sign in to comment.