Skip to content

Test --config and CLI error exits (coverage 90% → 95%) - #24

Merged
Skeyelab merged 1 commit into
refactor/transcriptfrom
test/config-and-cli-errors
Nov 13, 2026
Merged

Skeyelab merged 1 commit into
refactor/transcriptfrom
test/config-and-cli-errors

Conversation

@Skeyelab

Copy link
Copy Markdown
Member

Stacked on #23.

Summary

Tests only, all through main() with FakeTerminal:

--config   broken file · empty book → first contact · help · usage errors · refused write keeps going · Ctrl-D exits 0
--contacts missing named file → "create X" · searched list only for a search · $IMSG_AGENT_CONTACTS missing
--send     no body · unknown contact (no number leaked)
--find-groups  none found
read       no chat.db → one clean error

Evidence

  • Coverage 90% → 95%. 143 passed.
  • Mutation check, each guard broken in turn: send-body guard, no-groups message, add usage, config write error, searched hint, empty book, config load error. All 7 caught.

Merge Danger

Door: two-way

Blast Radius: none (tests only)

🤖 Generated with Claude Code

https://claude.ai/code/session_01VCgWWsJbTMzsnA2WJkmsjC

Covers the empty-book, help, usage, refused-write and broken-file paths of
--config, the missing-contacts-file hints, --send with no body or an unknown
contact, --find-groups with no groups, and a read with no chat.db. Each guard
was mutation-checked. Coverage 90% -> 95%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgWWsJbTMzsnA2WJkmsjC
@claude

claude Bot commented Nov 13, 2026

Copy link
Copy Markdown

Review: no blocking issues. This PR only adds tests (test_imsgread.py); no production code, README or typedstream decoder changes.

  • Privacy: only placeholders (friend, +15555550123, +1555…, nobody, loner) appear. No real identifiers.
  • Scoping: every new read and send test passes --chat or --contact. None exercises an unscoped path.
  • --robot: the new send tests pass --robot explicitly. The existing non-interactive refusal is in _resolve_marker_choice. This PR doesn't add a test for it, which is fine.
  • Read-only: the new tests don't touch the mode=ro open. test_reading_without_access_to_chat_db… only checks that a missing DB gives a clean error.
  • Tests: all 143 pass locally.

Not covered here (nothing in this diff changes them): the typedstream decoder, the contacts.toml lookup order beyond the env-file case, and the README install steps.

@Skeyelab
Skeyelab added this pull request to stack #25 November 13, 2026 17:08
@Skeyelab
Skeyelab merged commit 3428e82 into main Nov 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant