qtables error handling tests

This commit is contained in:
wiredfool 2014-09-24 14:15:17 -07:00
parent d6c16aa015
commit 306ad74324

View File

@ -295,6 +295,21 @@ class TestFileJpeg(PillowTestCase):
1: standard_chrominance_qtable}),
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")
def test_load_djpeg(self):
img = Image.open(TEST_FILE)