mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
qtables error handling tests
This commit is contained in:
parent
d6c16aa015
commit
306ad74324
|
@ -295,6 +295,21 @@ class TestFileJpeg(PillowTestCase):
|
||||||
1: standard_chrominance_qtable}),
|
1: standard_chrominance_qtable}),
|
||||||
30)
|
30)
|
||||||
|
|
||||||
|
# not a sequence
|
||||||
|
self.assertRaises(Exception, lambda: self.roundtrip(im, qtables='a'))
|
||||||
|
# sequence wrong length
|
||||||
|
self.assertRaises(Exception, lambda: self.roundtrip(im, qtables=[]))
|
||||||
|
# sequence wrong length
|
||||||
|
self.assertRaises(Exception, lambda: self.roundtrip(im, qtables=[1,2,3,4,5]))
|
||||||
|
|
||||||
|
# qtable entry not a sequence
|
||||||
|
self.assertRaises(Exception, lambda: self.roundtrip(im, qtables=[1]))
|
||||||
|
# qtable entry has wrong number of items
|
||||||
|
self.assertRaises(Exception, lambda: self.roundtrip(im, qtables=[[1,2,3,4]]))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipUnless(djpeg_available(), "djpeg not available")
|
@unittest.skipUnless(djpeg_available(), "djpeg not available")
|
||||||
def test_load_djpeg(self):
|
def test_load_djpeg(self):
|
||||||
img = Image.open(TEST_FILE)
|
img = Image.open(TEST_FILE)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user