vigilar/tests/conftest.py
Aaron D. Lee 845a85d618 Initial commit: Vigilar DIY home security system
Phase 1 (Foundation): project skeleton, TOML config + Pydantic validation,
MQTT bus wrapper, SQLite schema (9 tables), Click CLI, process supervisor.

Phase 2 (Camera): RTSP capture via OpenCV, MOG2 motion detection with
configurable sensitivity/zones, adaptive FPS recording (2fps idle/30fps
motion) via FFmpeg subprocess, HLS live streaming, pre-motion ring buffer.

Phase 3 (Web UI): Flask + Bootstrap 5 dark theme, 6 blueprints, Jinja2
templates (dashboard, kiosk 2x2 grid, events, sensors, recordings, settings),
PWA with service worker + Web Push, full admin settings UI with config
persistence.

Remote Access: WireGuard tunnel configs, nginx reverse proxy with HLS
caching + rate limiting, bandwidth-optimized remote HLS stream (426x240
@ 500kbps), DO droplet setup script, certbot TLS.

29 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 23:11:27 -04:00

36 lines
723 B
Python

"""Pytest fixtures for Vigilar tests."""
import os
import tempfile
from pathlib import Path
import pytest
from vigilar.config import VigilarConfig, load_config
from vigilar.storage.db import init_db
@pytest.fixture
def tmp_data_dir(tmp_path):
"""Temporary data directory for tests."""
data_dir = tmp_path / "data"
data_dir.mkdir()
return data_dir
@pytest.fixture
def test_db(tmp_data_dir):
"""Initialize a test database and return the engine."""
db_path = tmp_data_dir / "test.db"
return init_db(db_path)
@pytest.fixture
def sample_config():
"""Return a minimal VigilarConfig for testing."""
return VigilarConfig(
cameras=[],
sensors=[],
rules=[],
)