Skip to content

Commit 9860ba8

Browse files
NikitasT2003claude
andcommitted
test: end-to-end behavioural tests for every thesis subcommand
55 new tests covering every command's happy path, error paths, help, flags, and (for agent commands) prompt payloads + thread persistence. Commands tested - top-level: no-args-prints-help, --help lists all 9 commands, --version - setup: --help, --non-interactive for anthropic + openrouter, bad provider exits 2, --skip-examples respected - init: --help, --force vs preserve AGENTS.md, outline stub, urls.txt instructions, idempotency - status: --help, runs without key, no workspace mutation, reads persisted thread - ingest: --help, default dir, explicit dir, missing dir exits 1, idempotent skip, works without API key - curate/style/write/lint: * parametrised --help check across all four * prompts mention the expected keywords (pending, status, style/samples, STYLE.md, thesis/chapters, section id) * write requires section arg * --thread flag persists to data/.thread (parametrised) * agent errors surface + exit nonzero (parametrised) * persisted thread reused when --thread absent - chat: --help, single-turn then /quit, empty input skipped, /new rotates thread id mid-session, --new flag rotates, agent error surfaces + loop continues, /exit alias Test infrastructure - _StubAgent context manager wraps agent.build_agent so chat tests run fully offline - ws fixture swaps cli.console for a wide console so Rich tables render without CliRunner truncation - _record_invoke helper captures (prompt, thread_id) tuples for agent-dispatch assertions Coverage impact cli.py 74% → 81% TOTAL 82% → 86% 242 passed, 1 skipped (symlink rights) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fabff3e commit 9860ba8

1 file changed

Lines changed: 494 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)