tmux-amq/tests/test_config_defaults.py
tegwick 4d915a2617
Some checks failed
tamq-ci / test (push) Failing after 36s
Bootstrap tamq local tmux agent message queue
Assistant: codex
Assistant-Model: gpt-5.6-sol
Assistant-Session: 01a02f34-ead4-7a60-85cd-d7f08e22fa0e
2026-08-24 01:18:40 +02:00

20 lines
810 B
Python

from tamq.config import setting
def test_toml_defaults(monkeypatch, tmp_path):
config = tmp_path / "config.toml"
config.write_text("[tamq]\npurge_before='30d'\nhistory_max_size='12MB'\n")
monkeypatch.setenv("TAMQ_CONFIG", str(config))
assert setting("purge_before", "365d") == "30d"
assert setting("history_max_size", "100MB") == "12MB"
assert setting("missing", "fallback") == "fallback"
def test_delivery_interval_is_configurable(monkeypatch, tmp_path):
config = tmp_path / "config.toml"
config.write_text("[tamq]\ndelivery_poll_interval='2.5'\n")
monkeypatch.setenv("TAMQ_CONFIG", str(config))
from tamq.service import Service
from tamq.store import Store
service = Service(store=Store(tmp_path / "state.sqlite3"))
assert service.poll_interval == 2.5