Pillow/Tests/test_image_getextrema.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

18 lines
583 B
Python

from tester import *
from PIL import Image
def test_extrema():
def extrema(mode):
return lena(mode).getextrema()
assert_equal(extrema("1"), (0, 255))
assert_equal(extrema("L"), (40, 235))
assert_equal(extrema("I"), (40, 235))
assert_equal(extrema("F"), (40.0, 235.0))
assert_equal(extrema("P"), (11, 218)) # fixed palette
assert_equal(extrema("RGB"), ((61, 255), (26, 234), (44, 223)))
assert_equal(extrema("RGBA"), ((61, 255), (26, 234), (44, 223), (255, 255)))
assert_equal(extrema("CMYK"), ((0, 194), (21, 229), (32, 211), (0, 0)))