Add coverage for Bank deposit/withdraw invalid-amount retry - #132
Merged
Conversation
promptForNumber returns None whenever the player enters non-numeric text (see baseUserInterface.promptForNumber), and both deposit() and withdraw() loop back to re-prompt in that case, but neither branch had a test - bank.py sat at 96% coverage with exactly these two lines missing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric:
Repo-specific:
Coverage confirms |
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
schemas/*.jsonmatch their models). No backlog work was skipped/deferred this cycle since the backlog was empty.src/location/bank.pywas the only source file with a coverage gap that represents a real, player-reachable behavior —Bank.deposit()/Bank.withdraw()each loop back and re-prompt whenpromptForNumberreturnsNone(i.e. the player typed something non-numeric), but neither retry branch had a test.test_deposit_invalid_input_retries_then_succeedsandtest_withdraw_invalid_input_retries_then_succeeds, mirroring the sibling test structure already intests/location/test_bank.py, usingside_effect=[None, 10.0]to exercise the retry-then-succeed path deterministically.src/location/bank.pyis now at 100% line coverage (was 96%, missing exactly these two branches).Test plan
python3 -m compileall -q srctests/location/test_bank.pyalone: 25 passedsrc/location/bank.pyat 100%, no other file regressedCloses: none — no tracking issue existed; this is a proactive Stage B test-expansion cycle per the dev-loop's tiebreaker (documentation/coverage work preferred when the issue backlog is empty).