Test seek errors

This commit is contained in:
Andrew Murray 2020-01-14 21:13:05 +11:00
parent f3f9190de7
commit 760bc7dd38

View File

@ -164,3 +164,11 @@ class TestFileWebpAnimation(PillowTestCase):
self.assertEqual(im.info["duration"], dur)
self.assertEqual(im.info["timestamp"], ts)
ts -= dur
def test_seek_errors(self):
with Image.open("Tests/images/iss634.webp") as im:
with self.assertRaises(EOFError):
im.seek(-1)
with self.assertRaises(EOFError):
im.seek(42)