File: test_text.py

package info (click to toggle)
python-imgviz 1.5.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,132 kB
  • sloc: python: 3,354; makefile: 15
file content (13 lines) | stat: -rw-r--r-- 308 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
import numpy as np

import imgviz


def test_text():
    img = np.full((100, 100, 3), 255, dtype=np.uint8)
    res = imgviz.draw.text(
        img, yx=(0, 0), text="TEST", color=(0, 0, 0), size=30
    )
    assert res.shape == img.shape
    assert res.dtype == img.dtype
    assert not np.allclose(img, res)