Files
auto_el/tests/test_harvesting.py
T

24 lines
852 B
Python

from pathlib import Path
import analyze
HARVESTING = sorted(Path("tests/images/harvesting").glob("*.png"))
NOT_HARVESTING = sorted(Path("tests/images/not_harvesting").glob("*.png"))
assert len(HARVESTING) > 0, "no images found in tests/images/harvesting"
assert len(NOT_HARVESTING) > 0, "no images found in tests/images/not_harvesting"
def test_harvesting_frames_report_harvesting():
for path in HARVESTING:
image = analyze.load_image(path)
assert image is not None, f"cannot load {path}"
assert analyze.is_harvesting(image)["is_harvesting"] is True, path
def test_not_harvesting_frames_report_not_harvesting():
for path in NOT_HARVESTING:
image = analyze.load_image(path)
assert image is not None, f"cannot load {path}"
assert analyze.is_harvesting(image)["is_harvesting"] is False, path