mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-11 17:56:18 +03:00
Added test for GimpPaletteFile
This commit is contained in:
parent
53d0e75d3f
commit
63a32a9c5b
|
@ -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
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