Files
Artemis-Eapil/tests/unit/test_window_capture.py
T

20 lines
551 B
Python

"""Blank-capture guard without opening a desktop or native capture session."""
import numpy as np
from artemis.plugins.window_capture import has_picture
def test_black_or_cursor_only_frame_is_not_ready():
frame = np.zeros((256, 256, 4), dtype=np.uint8)
frame[:, :, 3] = 255
assert not has_picture(frame)
frame[0, 0, :3] = 255
assert not has_picture(frame)
def test_dark_page_with_visible_controls_is_valid():
frame = np.zeros((256, 256, 4), dtype=np.uint8)
frame[40:60, 40:120, :3] = 50
assert has_picture(frame)