From c79204bf08c23ffa92f20d85e37e4e5e365fb342 Mon Sep 17 00:00:00 2001 From: hugovk Date: Sat, 4 Mar 2017 19:54:06 +0200 Subject: [PATCH] Test XVThumbImagePlugin for correctness --- Tests/test_file_xvthumb.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Tests/test_file_xvthumb.py b/Tests/test_file_xvthumb.py index a4e1e6554..62b8a2136 100644 --- a/Tests/test_file_xvthumb.py +++ b/Tests/test_file_xvthumb.py @@ -1,10 +1,20 @@ -from helper import unittest, PillowTestCase +from helper import hopper, unittest, PillowTestCase -from PIL import XVThumbImagePlugin +from PIL import Image, XVThumbImagePlugin + +TEST_FILE = "Tests/images/hopper.p7" class TestFileXVThumb(PillowTestCase): + def test_open(self): + # Act + im = Image.open(TEST_FILE) + + # Assert + self.assertEqual(im.format, "XVThumb") + self.assert_image_similar(im, hopper("P"), 49) + def test_invalid_file(self): invalid_file = "Tests/images/flower.jpg"