mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-30 10:43:16 +03:00
Test unexpected EOF
This commit is contained in:
parent
dc3233d52c
commit
a03a6e2049
|
@ -15,9 +15,21 @@ class TestFileXVThumb(PillowTestCase):
|
||||||
self.assertEqual(im.format, "XVThumb")
|
self.assertEqual(im.format, "XVThumb")
|
||||||
self.assert_image_similar(im, hopper("P"), 49)
|
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):
|
def test_invalid_file(self):
|
||||||
|
# Arrange
|
||||||
invalid_file = "Tests/images/flower.jpg"
|
invalid_file = "Tests/images/flower.jpg"
|
||||||
|
|
||||||
|
# Act / Assert
|
||||||
self.assertRaises(SyntaxError,
|
self.assertRaises(SyntaxError,
|
||||||
lambda:
|
lambda:
|
||||||
XVThumbImagePlugin.XVThumbImageFile(invalid_file))
|
XVThumbImagePlugin.XVThumbImageFile(invalid_file))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user