mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-02 23:13:40 +03:00
Merge pull request #2659 from radarhere/sgi_tests
Added tests for SgiImagePlugin
This commit is contained in:
commit
b4a373eae7
|
@ -55,6 +55,22 @@ class TestFileSgi(PillowTestCase):
|
||||||
for mode in ('L', 'RGB', 'RGBA'):
|
for mode in ('L', 'RGB', 'RGBA'):
|
||||||
roundtrip(hopper(mode))
|
roundtrip(hopper(mode))
|
||||||
|
|
||||||
|
# Test 1 dimension for an L mode image
|
||||||
|
roundtrip(Image.new('L', (10, 1)))
|
||||||
|
|
||||||
|
def test_unsupported_mode(self):
|
||||||
|
im = hopper('LA')
|
||||||
|
out = self.tempfile('temp.sgi')
|
||||||
|
|
||||||
|
self.assertRaises(ValueError, lambda: im.save(out, format='sgi'))
|
||||||
|
|
||||||
|
def test_incorrect_number_of_bands(self):
|
||||||
|
im = hopper('YCbCr')
|
||||||
|
im.mode = 'RGB'
|
||||||
|
out = self.tempfile('temp.sgi')
|
||||||
|
|
||||||
|
self.assertRaises(ValueError, lambda: im.save(out, format='sgi'))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user