[loop-cycle-53] refactor: break circular imports between packages (#164) (#193)
Some checks failed
Tests / lint (push) Failing after 3s
Tests / test (push) Has been skipped

This commit was merged in pull request #193.
This commit is contained in:
2026-03-15 12:52:18 -04:00
parent b3840238cb
commit 4a68f6cb8b
10 changed files with 195 additions and 173 deletions

View File

@@ -1,6 +1,7 @@
"""Tests for SQLite-backed chat persistence (issue #46)."""
from dashboard.store import Message, MessageLog
import infrastructure.chat_store as _chat_store
def test_persistence_across_instances(tmp_path):
@@ -24,10 +25,8 @@ def test_persistence_across_instances(tmp_path):
def test_retention_policy(tmp_path):
"""Oldest messages are pruned when count exceeds MAX_MESSAGES."""
import dashboard.store as store_mod
original_max = store_mod.MAX_MESSAGES
store_mod.MAX_MESSAGES = 5 # Small limit for testing
original_max = _chat_store.MAX_MESSAGES
_chat_store.MAX_MESSAGES = 5 # Small limit for testing
try:
db = tmp_path / "chat.db"
@@ -42,7 +41,7 @@ def test_retention_policy(tmp_path):
assert msgs[-1].content == "msg-7"
log.close()
finally:
store_mod.MAX_MESSAGES = original_max
_chat_store.MAX_MESSAGES = original_max
def test_clear_removes_all(tmp_path):