Add (failing) test for #771

This commit is contained in:
hugovk 2014-07-05 21:55:19 +03:00
parent 4b4ed2c9b1
commit ff668ae54e

View File

@ -39,6 +39,18 @@ class TestDecompressionBomb(PillowTestCase):
Image.DecompressionBombWarning,
lambda: Image.open(test_file))
def test_image_new(self):
# Arrange
# Set limit to a low, easily testable value
Image.MAX_IMAGE_PIXELS = 10
self.assertEqual(Image.MAX_IMAGE_PIXELS, 10)
# Act / Assert
self.assert_warning(
Image.DecompressionBombWarning,
lambda: Image.new('L', (100, 100), 0))
if __name__ == '__main__':
unittest.main()