Files
PaperPod/tests/test_config.py
T
ilia 6a78c84bcd Initial scaffold: capture + vision modules with detect CLI
- capture/: frame sampling at configurable fps, ffmpeg audio extraction (WAV, whisper-ready)
- vision/: changed-pixel motion scoring, stable/moving segmentation, contour + perspective document detection, Laplacian sharpness scoring, optional CLAHE enhancement
- pipeline: two-pass detect (motion timeline, then best-frame crop per stable window) writing crops, debug frames, report.json, and motion_scores.csv
- CLI: probe / detect / extract-audio subcommands
- config.yaml with tunable thresholds; placeholder packages for events, transcribe, ocr, naming, pdf, review_cli
- synthetic sample video generator + 16 unit tests
2026-07-07 16:24:46 -04:00

27 lines
734 B
Python

from paperpod.config import load_config
def test_defaults_without_file():
cfg = load_config(None)
assert cfg.capture.sample_fps == 8.0
assert cfg.motion.threshold == 0.02
assert cfg.motion.pixel_threshold == 12
def test_partial_override(tmp_path):
p = tmp_path / "config.yaml"
p.write_text("motion:\n threshold: 7.5\n")
cfg = load_config(p)
assert cfg.motion.threshold == 7.5
# untouched keys keep defaults
assert cfg.motion.stable_min_duration_s == 1.0
assert cfg.capture.sample_fps == 8.0
def test_repo_config_loads():
from pathlib import Path
repo_cfg = Path(__file__).parent.parent / "config.yaml"
cfg = load_config(repo_cfg)
assert cfg.output.dir == "./output"