mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
bb1b3a532c
find * -type f "-(" -name "*.bdf" -o -name "*.c" -o -name "*.h" -o -name "*.py" -o -name "*.rst" -o -name "*.txt" "-)" -exec sed -e "s/[[:space:]]*$//" -i {} \;
28 lines
886 B
Python
28 lines
886 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"))
|