Add CLI test coverage and close remaining explore.py coverage gaps - #69
Merged
Conversation
cli.py had zero test coverage (0%). Add tests/test_cli.py covering the new/list/explore subcommands, policy-deny path, unknown-issue error handling, and --engine dispatch wiring, faking the gh/Claude CLI subprocess boundary rather than mocking internal modules. Also close the remaining explore.py gaps: the deterministic-only render branches (web prior art + similar ideas with no Engine attached) and the unparsable-Engine-reply degrade path. Investigated the markdown-fence JSON-parsing concern flagged for this file; fence-stripping already happens in ClaudeCLIEngine (mythings-core) before explore.py ever sees the text, so no bug there — just added a regression test for the belt-and-suspenders JSONDecodeError degrade in _propose_brief. Coverage: TOTAL 78% -> 99% (cli.py 0% -> 98%, explore.py 95% -> 99%). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cli.pyhad 0% test coverage; addtests/test_cli.pycoveringnew/list/exploresubcommands, policy-deny, unknown-issue error handling, and--enginedispatch wiring.explore.pycoverage gaps (deterministic-only render branches, unparsable-Engine-reply degrade).ClaudeCLIEngine(mythings-core, commit1cc97f8) beforeexplore.pyever seesresult.text, so there's no bug here. Added a regression test for the belt-and-suspendersJSONDecodeErrordegrade path in_propose_briefinstead.cli.pyor the remainingexplore.pygaps — all were correct code, just untested. No GitHub issue filed.Coverage: TOTAL 78% -> 99% (
cli.py0% -> 98%,explore.py95% -> 99%).Test plan
pytest --cov=src --cov-report=term-missing— 29 tests pass, 99% total coverageruff check src tests— clean🤖 Generated with Claude Code