Pillow/Tests/test_file_pcx.py
Brian Crowell ad784eb808 py3k: Import Christoph Gohlke's test suite
This is Christoph Gohlke's test suite from his personal PIL package found
at http://www.lfd.uci.edu/~gohlke/pythonlibs/.

This is just to bring it in as a separate commit. Future commits will align
it with Pillow.
2013-01-10 08:46:39 -06:00

40 lines
825 B
Python

from tester import *
from PIL import Image
def test_sanity():
file = tempfile("temp.pcx")
lena("1").save(file)
im = Image.open(file)
im.load()
assert_equal(im.mode, "1")
assert_equal(im.size, (128, 128))
assert_equal(im.format, "PCX")
lena("1").save(file)
im = Image.open(file)
lena("L").save(file)
im = Image.open(file)
lena("P").save(file)
im = Image.open(file)
lena("RGB").save(file)
im = Image.open(file)
def test_pil184():
# Check reading of files where xmin/xmax is not zero.
file = "Tests/images/pil184.pcx"
im = Image.open(file)
assert_equal(im.size, (447, 144))
assert_equal(im.tile[0][1], (0, 0, 447, 144))
# Make sure all pixels are either 0 or 255.
assert_equal(im.histogram()[0] + im.histogram()[255], 447*144)