Add tests for parsing, image loading, display detection and CLI
Tesseract is stubbed out except in one end-to-end smoke test on a sample photo, which is skipped when the binary is not installed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from pathlib import Path
|
||||
|
||||
import cv2 as cv
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def monitor_photo() -> np.ndarray:
|
||||
"""A synthetic photo: dark background with one light, square 'display'."""
|
||||
arr = np.full((600, 800, 3), 30, dtype=np.uint8)
|
||||
cv.rectangle(arr, (300, 200), (500, 400), (200, 200, 200), thickness=-1)
|
||||
return arr
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def monitor_photo_path(tmp_path: Path, monitor_photo: np.ndarray) -> Path:
|
||||
path = tmp_path / "monitor.png"
|
||||
cv.imwrite(str(path), monitor_photo)
|
||||
return path
|
||||
Reference in New Issue
Block a user