Fredrik Lundh is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

effbot / pil-2009-raclette http://effbot.org/zone/pil-index.htm

Work repository for PIL 1.1.7 and beyond. The "default" branch should be fairly solid, the other branches less so. For production use, see the pil-117 repository.

Clone this repository (size: 1.6 MB): HTTPS / SSH
hg clone https://bitbucket.org/effbot/pil-2009-raclette
hg clone ssh://hg@bitbucket.org/effbot/pil-2009-raclette

pil-2009-raclette / Tests / test_image_getbands.py

from tester import *

from PIL import Image

def test_getbands():

    assert_equal(Image.new("1", (1, 1)).getbands(), ("1",))
    assert_equal(Image.new("L", (1, 1)).getbands(), ("L",))
    assert_equal(Image.new("I", (1, 1)).getbands(), ("I",))
    assert_equal(Image.new("F", (1, 1)).getbands(), ("F",))
    assert_equal(Image.new("P", (1, 1)).getbands(), ("P",))
    assert_equal(Image.new("RGB", (1, 1)).getbands(), ("R", "G", "B"))
    assert_equal(Image.new("RGBA", (1, 1)).getbands(), ("R", "G", "B", "A"))
    assert_equal(Image.new("CMYK", (1, 1)).getbands(), ("C", "M", "Y", "K"))
    assert_equal(Image.new("YCbCr", (1, 1)).getbands(), ("Y", "Cb", "Cr"))