mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
40 lines
993 B
Python
40 lines
993 B
Python
from helper import unittest, PillowTestCase
|
|
|
|
from PIL import Image
|
|
|
|
|
|
class TestFileSgi(PillowTestCase):
|
|
|
|
def test_rgb(self):
|
|
# Arrange
|
|
# Created with ImageMagick then renamed:
|
|
# convert hopper.ppm hopper.sgi
|
|
test_file = "Tests/images/hopper.rgb"
|
|
|
|
# Act / Assert
|
|
self.assertRaises(ValueError, lambda: Image.open(test_file))
|
|
|
|
def test_l(self):
|
|
# Arrange
|
|
# Created with ImageMagick then renamed:
|
|
# convert hopper.ppm -monochrome hopper.sgi
|
|
test_file = "Tests/images/hopper.bw"
|
|
|
|
# Act / Assert
|
|
self.assertRaises(ValueError, lambda: Image.open(test_file))
|
|
|
|
def test_rgba(self):
|
|
# Arrange
|
|
# Created with ImageMagick:
|
|
# convert transparent.png transparent.sgi
|
|
test_file = "Tests/images/transparent.sgi"
|
|
|
|
# Act / Assert
|
|
self.assertRaises(ValueError, lambda: Image.open(test_file))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|
|
|
|
# End of file
|