-
Notifications
You must be signed in to change notification settings - Fork 1
Add CLI test coverage (cli.py has zero tests) #16
Copy link
Copy link
Open
Labels
area: cliCLI commands and optionsCLI commands and optionsarea: testsTest coverage and qualityTest coverage and qualitydifficulty: intermediateRequires some familiarity with the codebaseRequires some familiarity with the codebaseenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Metadata
Metadata
Assignees
Labels
area: cliCLI commands and optionsCLI commands and optionsarea: testsTest coverage and qualityTest coverage and qualitydifficulty: intermediateRequires some familiarity with the codebaseRequires some familiarity with the codebaseenhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Problem
cli.pyis the largest file in the project at 1105 lines and has zero test coverage. Theinstallanduninstallcommands modify Claude Code'ssettings.json. Thestatus,anomalies,healthcommands all have logic that could break silently. New contributors modifying CLI behavior have no regression safety net.What to do
Create
tests/test_cli.pywith at least:installcommand — verify hooks are written to the correct locationuninstallcommand — verify hook entries are removed from settings.jsonstatuscommand — with mocked HTTP responseshealthcommand — with mocked HTTP responsesconfig show(if implemented) — verify output includes all config sectionsRecommended approach
typer.testing.CliRunnerfor invoking commandstmp_pathfixtures for filesystem operationsrespxorunittest.mock.patchto mockhttpxcalls to the collectorFiles to look at
src/context_analyzer_tool/cli.py— the module under testtests/test_config.py— good example of how existing tests are structured