mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
ad784eb808
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.
28 lines
890 B
Python
28 lines
890 B
Python
from tester import *
|
|
|
|
from PIL import Image
|
|
|
|
def test_sanity():
|
|
|
|
im = lena()
|
|
assert_no_exception(lambda: im.mode)
|
|
|
|
def test_properties():
|
|
def check(mode, *result):
|
|
signature = (
|
|
Image.getmodebase(mode), Image.getmodetype(mode),
|
|
Image.getmodebands(mode), Image.getmodebandnames(mode),
|
|
)
|
|
assert_equal(signature, result)
|
|
check("1", "L", "L", 1, ("1",))
|
|
check("L", "L", "L", 1, ("L",))
|
|
check("P", "RGB", "L", 1, ("P",))
|
|
check("I", "L", "I", 1, ("I",))
|
|
check("F", "L", "F", 1, ("F",))
|
|
check("RGB", "RGB", "L", 3, ("R", "G", "B"))
|
|
check("RGBA", "RGB", "L", 4, ("R", "G", "B", "A"))
|
|
check("RGBX", "RGB", "L", 4, ("R", "G", "B", "X"))
|
|
check("RGBX", "RGB", "L", 4, ("R", "G", "B", "X"))
|
|
check("CMYK", "RGB", "L", 4, ("C", "M", "Y", "K"))
|
|
check("YCbCr", "RGB", "L", 3, ("Y", "Cb", "Cr"))
|