Test unexpected EOF

This commit is contained in:
hugovk 2017-03-04 23:33:43 +02:00
parent dc3233d52c
commit a03a6e2049

View File

@ -15,9 +15,21 @@ class TestFileXVThumb(PillowTestCase):
self.assertEqual(im.format, "XVThumb")
self.assert_image_similar(im, hopper("P"), 49)
def test_unexpected_eof(self):
# Test unexpected EOF reading XV thumbnail file
# Arrange
bad_file = "Tests/images/hopper_bad.p7"
# Act / Assert
self.assertRaises(SyntaxError,
lambda:
XVThumbImagePlugin.XVThumbImageFile(bad_file))
def test_invalid_file(self):
# Arrange
invalid_file = "Tests/images/flower.jpg"
# Act / Assert
self.assertRaises(SyntaxError,
lambda:
XVThumbImagePlugin.XVThumbImageFile(invalid_file))