[loop-cycle] test: add unit tests for chat_store.py (#1192) #1202

Closed
Timmy wants to merge 1 commits from test/chat-store-unit-tests into main
Owner

What

Adds 27 unit tests for src/infrastructure/chat_store.py (155 lines, previously 0 tests).

Tests cover

  • Message dataclass defaults and fields
  • _get_conn context manager (DB creation, parent dirs, connection closing)
  • MessageLog CRUD: append, all, recent, clear, len
  • Ordering guarantees (all returns id-order, recent returns oldest-first window)
  • Pruning behavior (MAX_MESSAGES enforcement)
  • Close/reopen lifecycle
  • Thread safety (concurrent appends)
  • Edge cases: empty content, unicode, multiline, SQL injection

Result

329 tests pass (was 302). No production code changes.

Closes #1192

## What Adds 27 unit tests for `src/infrastructure/chat_store.py` (155 lines, previously 0 tests). ## Tests cover - Message dataclass defaults and fields - _get_conn context manager (DB creation, parent dirs, connection closing) - MessageLog CRUD: append, all, recent, clear, len - Ordering guarantees (all returns id-order, recent returns oldest-first window) - Pruning behavior (MAX_MESSAGES enforcement) - Close/reopen lifecycle - Thread safety (concurrent appends) - Edge cases: empty content, unicode, multiline, SQL injection ## Result 329 tests pass (was 302). No production code changes. Closes #1192
Timmy added 1 commit 2026-03-23 22:00:26 +00:00
test: add unit tests for chat_store.py (#1192)
Some checks failed
Tests / lint (pull_request) Failing after 15s
Tests / test (pull_request) Has been skipped
845070f70b
Author
Owner

Closing — this work was already merged. Already merged as #1198.

Closing — this work was already merged. Already merged as #1198.
Timmy closed this pull request 2026-03-23 22:04:08 +00:00
Some checks failed
Tests / lint (pull_request) Failing after 15s
Tests / test (pull_request) Has been skipped

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1202