2023-12-21 14:13:31 +03:00
|
|
|
from __future__ import annotations
|
2024-01-20 14:23:03 +03:00
|
|
|
|
2012-10-16 00:26:38 +04:00
|
|
|
from PIL import Image
|
|
|
|
|
2019-07-06 23:40:53 +03:00
|
|
|
|
2024-01-25 14:18:46 +03:00
|
|
|
def test_getbands() -> None:
|
2019-11-04 01:18:55 +03:00
|
|
|
assert Image.new("1", (1, 1)).getbands() == ("1",)
|
|
|
|
assert Image.new("L", (1, 1)).getbands() == ("L",)
|
|
|
|
assert Image.new("I", (1, 1)).getbands() == ("I",)
|
|
|
|
assert Image.new("F", (1, 1)).getbands() == ("F",)
|
|
|
|
assert Image.new("P", (1, 1)).getbands() == ("P",)
|
|
|
|
assert Image.new("RGB", (1, 1)).getbands() == ("R", "G", "B")
|
|
|
|
assert Image.new("RGBA", (1, 1)).getbands() == ("R", "G", "B", "A")
|
|
|
|
assert Image.new("CMYK", (1, 1)).getbands() == ("C", "M", "Y", "K")
|
|
|
|
assert Image.new("YCbCr", (1, 1)).getbands() == ("Y", "Cb", "Cr")
|