2014-07-16 22:28:17 +04:00
|
|
|
from helper import unittest, PillowTestCase
|
|
|
|
|
|
|
|
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
class TestFileSgi(PillowTestCase):
|
|
|
|
|
|
|
|
def test_rgb(self):
|
|
|
|
# Arrange
|
|
|
|
# Created with ImageMagick then renamed:
|
|
|
|
# convert lena.ppm lena.sgi
|
|
|
|
test_file = "Tests/images/lena.rgb"
|
|
|
|
|
|
|
|
# Act / Assert
|
2014-07-20 02:50:05 +04:00
|
|
|
self.assertRaises(ValueError, lambda: Image.open(test_file))
|
2014-07-16 22:28:17 +04:00
|
|
|
|
|
|
|
def test_l(self):
|
|
|
|
# Arrange
|
|
|
|
# Created with ImageMagick then renamed:
|
|
|
|
# convert lena.ppm -monochrome lena.sgi
|
|
|
|
test_file = "Tests/images/lena.bw"
|
|
|
|
|
|
|
|
# Act / Assert
|
2014-07-20 02:50:05 +04:00
|
|
|
self.assertRaises(ValueError, lambda: Image.open(test_file))
|
2014-07-16 22:28:17 +04:00
|
|
|
|
|
|
|
def test_rgba(self):
|
|
|
|
# Arrange
|
|
|
|
# Created with ImageMagick:
|
|
|
|
# convert transparent.png transparent.sgi
|
|
|
|
test_file = "Tests/images/transparent.sgi"
|
|
|
|
|
|
|
|
# Act / Assert
|
2014-07-20 02:50:05 +04:00
|
|
|
self.assertRaises(ValueError, lambda: Image.open(test_file))
|
2014-07-16 22:28:17 +04:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|
|
|
|
|
|
|
|
# End of file
|