init commit

This commit is contained in:
2026-04-01 13:53:09 -03:00
commit 453601c072
22 changed files with 1525 additions and 0 deletions

49
tests/test_config.py Normal file
View File

@@ -0,0 +1,49 @@
"""Tests for cht.config — verify defaults are sane."""
from pathlib import Path
from cht.config import (
APP_ID,
APP_NAME,
DATA_DIR,
SESSIONS_DIR,
STREAM_HOST,
STREAM_PORT,
SCENE_THRESHOLD,
MAX_FRAME_INTERVAL,
SEGMENT_DURATION,
)
def test_app_id_format():
assert "." in APP_ID
assert APP_ID.startswith("com.")
def test_data_dir_under_home():
assert str(DATA_DIR).startswith(str(Path.home()))
def test_sessions_dir_under_data():
assert str(SESSIONS_DIR).startswith(str(DATA_DIR))
def test_stream_host_binds_all():
assert STREAM_HOST == "0.0.0.0"
def test_stream_port_is_int():
assert isinstance(STREAM_PORT, int)
assert 1024 <= STREAM_PORT <= 65535
def test_scene_threshold_range():
assert 0 < SCENE_THRESHOLD < 1
def test_max_frame_interval_positive():
assert MAX_FRAME_INTERVAL > 0
def test_segment_duration_positive():
assert SEGMENT_DURATION > 0