Files
tuimble/tests/test_config.py
Username 31ac90d2c9 fix: ptt auto-detect falls back to toggle mode
Textual does not expose key-release events, so KittyPtt
hold-mode never received key_up and stayed transmitting.
Auto-detect now tries evdev first, then falls back to
toggle (press-on/press-off). Default mode changed to toggle.
2026-02-24 12:50:40 +01:00

24 lines
581 B
Python

"""Tests for configuration module."""
from tuimble.config import Config, PttConfig, ServerConfig
def test_default_config():
cfg = Config()
assert cfg.server.host == "localhost"
assert cfg.server.port == 64738
assert cfg.audio.sample_rate == 48000
assert cfg.ptt.mode == "toggle"
def test_server_config():
srv = ServerConfig(host="mumble.example.com", port=12345)
assert srv.host == "mumble.example.com"
assert srv.port == 12345
def test_ptt_config_defaults():
ptt = PttConfig()
assert ptt.key == "f4"
assert ptt.backend == "auto"