bookmark/tests/test_config.py
pyr0ball c28afe0ac4 feat: add config loading, calibration script, and production entrypoint
Wires together AppConfig.load() (JSON config -> markers/guide_box),
calibrate.py (one-time empty-platform reference capture), and run.py
(build_strategy dispatch + camera/session/FastAPI wiring via uvicorn)
to complete Phase 1 intake station integration.
2026-07-13 11:08:48 -07:00

27 lines
887 B
Python

import json
from bookmark.config import AppConfig
def test_load_config_from_json(tmp_path):
config_data = {
"device_index": 0,
"catalogue_path": str(tmp_path / "catalogue.csv"),
"captures_dir": str(tmp_path / "captures"),
"reference_frame_path": str(tmp_path / "reference.jpg"),
"markers": [
{"name": "small_boundary", "bucket": "small", "x": 0, "y": 0, "width": 10, "height": 10},
],
"guide_box": [20, 20, 60, 60],
"trigger_strategy": "manual",
}
config_path = tmp_path / "config.json"
config_path.write_text(json.dumps(config_data))
config = AppConfig.load(config_path)
assert config.device_index == 0
assert config.trigger_strategy == "manual"
assert config.guide_box == (20, 20, 60, 60)
assert len(config.markers) == 1
assert config.markers[0].bucket == "small"