mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
28 lines
652 B
Python
28 lines
652 B
Python
from helper import hopper, unittest, PillowTestCase
|
|
|
|
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"
|
|
|
|
self.assertRaises(SyntaxError,
|
|
lambda:
|
|
XVThumbImagePlugin.XVThumbImageFile(invalid_file))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|