diff --git a/Tests/test_file_spider.py b/Tests/test_file_spider.py index 9c15de804..d93724492 100644 --- a/Tests/test_file_spider.py +++ b/Tests/test_file_spider.py @@ -1,6 +1,7 @@ from tester import * from PIL import Image +from PIL import SpiderImagePlugin test_file = "Tests/images/lena.spider" @@ -12,4 +13,24 @@ def test_sanity(): assert_equal(im.size, (128, 128)) assert_equal(im.format, "SPIDER") + +def test_save(): + # Arrange + temp = tempfile('temp.spider') + im = lena() + + # Act + im.save(temp, "SPIDER") + + # Assert + im2 = Image.open(temp) + assert_equal(im2.mode, "F") + assert_equal(im2.size, (128, 128)) + assert_equal(im2.format, "SPIDER") + + +def test_isSpiderImage(): + assert_true(SpiderImagePlugin.isSpiderImage(test_file)) + + # End of file