Add comprehensive test coverage for untested code paths#5
Merged
Conversation
Adds 27 new tests covering previously untested areas: - sanitize_id() function: 6 unit tests for dots, slashes, edge cases - SlashCommandAutoComplete.get_candidates(): 8 tests for all branches - ModelPanel.compose(): 2 tests verifying Static/RichLog composition - PromptInput edge cases: 3 tests (whitespace, case sensitivity) - handle_slash_command edge cases: 3 tests (whitespace, unknown cmds) - main() entry point: 1 test - Multiple operations: 2 tests (consecutive prompts, special chars) - SlashCommand dataclass: 2 tests (fields, handler validation) Increases test count from 42 to 69 tests.
The test incorrectly assumed " /new" would be treated as a regular prompt. However, PromptInput.on_key() calls strip() before checking if input starts with "/", so leading spaces are removed and the command executes normally. Updated test to verify this actual behavior.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Add pytest-cov to dev dependencies and configure pytest to: - Run coverage on app module by default - Show missing lines in coverage report - Fail if coverage drops below 100% This runs automatically with `pytest` locally and in CI.
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.
Adds 27 new tests covering previously untested areas:
Increases test count from 42 to 69 tests.