mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 08:14:10 +03:00
Merge pull request #1324 from radarhere/gimp_test
Added test for GimpPaletteFile
This commit is contained in:
commit
2a8efbaf3f
|
@ -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
4
Tests/images/test.gpl
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
GIMP Palette
|
||||||
|
Name: Test
|
||||||
|
Columns: 0
|
||||||
|
#
|
19
Tests/test_file_gimppalette.py
Normal file
19
Tests/test_file_gimppalette.py
Normal 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
|
Loading…
Reference in New Issue
Block a user