mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +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.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))
|
||||
|
|
Loading…
Reference in New Issue
Block a user