Added test for GimpPaletteFile

This commit is contained in:
Andrew Murray 2015-07-01 15:47:47 +10:00
parent 53d0e75d3f
commit 63a32a9c5b
3 changed files with 24 additions and 0 deletions

View File

@ -29,6 +29,7 @@ recursive-include Tests *.eps
recursive-include Tests *.fli
recursive-include Tests *.ggr
recursive-include Tests *.gif
recursive-include Tests *.gpl
recursive-include Tests *.gnuplot
recursive-include Tests *.html
recursive-include Tests *.icc

4
Tests/images/test.gpl Normal file
View File

@ -0,0 +1,4 @@
GIMP Palette
Name: Test
Columns: 0
#

View File

@ -0,0 +1,19 @@
from helper import unittest, PillowTestCase
from PIL.GimpPaletteFile import GimpPaletteFile
class TestImage(PillowTestCase):
def test_sanity(self):
with open('Tests/images/test.gpl', 'rb') as fp:
GimpPaletteFile(fp)
with open('Tests/images/hopper.jpg', 'rb') as fp:
self.assertRaises(SyntaxError, lambda: GimpPaletteFile(fp))
if __name__ == '__main__':
unittest.main()
# End of file