test(examples): add pytest tests for mathkit Calculator (ABCA-733)#54
Conversation
Add examples/mathkit/test_calculator.py covering the Calculator class from calculator.py: arithmetic methods, method chaining, reset, and divide-by-zero error handling. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Task-Id: 01KXVXM7N1B2GYRBK181SA0GG7 Prompt-Version: 1c9c10e027a2
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
ABCA-733 — [mathkit-3 depends-on-2] Adds
examples/mathkit/test_calculator.pywith pytest tests that importCalculatorfrom the siblingcalculator.pymodule (ABCA-732).This is the third step of the mathkit dependency chain:
operations.pycalculator.py— this PR is based on that branchtest_calculator.py— this PRTests added
15 test cases covering the
Calculatorclass:add,subtract,multiply,divide)ValueErrorreset()to default and to a specific valueselfCalculator(2).add(3).multiply(4).value == 20.0)addcaseVerification
Run from within
examples/mathkit:Result:
15 passed.Notes
calculator.py, which isn't merged yet. Retarget once mathkit-2 lands.cdk/src/handlers/shared/orchestration-comment-trigger.ts,scripts/linear_epic.py) that this change does not touch.🤖 Generated with Claude Code