Merge pull request #1324 from radarhere/gimp_test

Added test for GimpPaletteFile
This commit is contained in:
Hugo van Kemenade 2015-07-01 09:07:15 +03:00
commit 2a8efbaf3f
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 *.fli
recursive-include Tests *.ggr recursive-include Tests *.ggr
recursive-include Tests *.gif recursive-include Tests *.gif
recursive-include Tests *.gpl
recursive-include Tests *.gnuplot recursive-include Tests *.gnuplot
recursive-include Tests *.html recursive-include Tests *.html
recursive-include Tests *.icc 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