File: test_text.py

package info (click to toggle)
python-imgviz 1.7.5%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,084 kB
  • sloc: python: 3,229; makefile: 15
file content (11 lines) | stat: -rw-r--r-- 294 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
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)