Pillow/Tests/check_j2k_overflow.py
Jon Dufresne f041188050 Replace try/except/fail pattern with TestCase.assertRaises()
Replace pattern with the builtin support for asserting exceptions.
2016-11-06 13:43:09 -08:00

15 lines
354 B
Python

from PIL import Image
from helper import unittest, PillowTestCase
class TestJ2kEncodeOverflow(PillowTestCase):
def test_j2k_overflow(self):
im = Image.new('RGBA', (1024, 131584))
target = self.tempfile('temp.jpc')
with self.assertRaises(IOError):
im.save(target)
if __name__ == '__main__':
unittest.main()