File: test_000_sanity.py

package info (click to toggle)
pillow 12.0.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 72,636 kB
  • sloc: python: 49,518; ansic: 38,787; makefile: 302; sh: 168; javascript: 85
file content (20 lines) | stat: -rw-r--r-- 545 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from __future__ import annotations

from PIL import Image


def test_sanity() -> None:
    # Make sure we have the binary extension
    Image.core.new("L", (100, 100))

    # Create an image and do stuff with it.
    im = Image.new("1", (100, 100))
    assert (im.mode, im.size) == ("1", (100, 100))
    assert len(im.tobytes()) == 1300

    # Create images in all remaining major modes.
    Image.new("L", (100, 100))
    Image.new("P", (100, 100))
    Image.new("RGB", (100, 100))
    Image.new("I", (100, 100))
    Image.new("F", (100, 100))