This commit is contained in:
Hugo 2018-09-26 14:09:31 +03:00 committed by GitHub
parent 36baea18ee
commit 2389492f96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,6 @@ TEST_FILE = "Tests/images/hopper.ppm"
ORIGINAL_LIMIT = Image.MAX_IMAGE_PIXELS ORIGINAL_LIMIT = Image.MAX_IMAGE_PIXELS
from PIL.Image import DecompressionBombWarning, DecompressionBombError
class TestDecompressionBomb(PillowTestCase): class TestDecompressionBomb(PillowTestCase):
@ -79,11 +78,12 @@ class TestDecompressionCrop(PillowTestCase):
self.assertEqual(im.crop(value).size, (9, 9)) self.assertEqual(im.crop(value).size, (9, 9))
for value in warning_values: for value in warning_values:
self.assert_warning(DecompressionBombWarning, im.crop, value) self.assert_warning(Image.DecompressionBombWarning, im.crop, value)
for value in error_values: for value in error_values:
with self.assertRaises(DecompressionBombError): with self.assertRaises(Image.DecompressionBombError):
im.crop(value) im.crop(value)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()