-
Notifications
You must be signed in to change notification settings - Fork 0
test: add unit tests for PR#19 #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rohitvinnakota-codecov-patch-17
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,3 +29,12 @@ def test_divide(): | |
| assert Calculator.divide(0, 2.0) == 0 | ||
| assert Calculator.divide(-4, 2.0) == -2.0 | ||
| # assert Calculator.divide(2.0, 0.0) == 'Cannot divide by 0' | ||
|
|
||
| def test_divide2(): | ||
| assert Calculator.divide2(1, 2) == 0.5 | ||
| assert Calculator.divide2(1.0, 2.0) == 0.5 | ||
| assert Calculator.divide2(0, 2.0) == 0 | ||
| assert Calculator.divide2(-4, 2.0) == -2.0 | ||
| assert Calculator.divide2(10, 5) == 2.0 | ||
| assert Calculator.divide2(-10, -5) == 2.0 | ||
| assert Calculator.divide2(2.0, 0.0) == 'Cannot divide by 0' | ||
|
Comment on lines
+32
to
+40
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test function Did we get this right? 👍 / 👎 to inform future reviews. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test function
test_divide2()referencesCalculator.divide2(), but this method does not exist in the Calculator class (see app/calculator.py). The test will fail with an AttributeError. Thedivide2()method must be implemented in the Calculator class before this test can pass. According to the repository context, this method should handle division by zero by returning the string 'Cannot divide by 0'.Did we get this right? 👍 / 👎 to inform future reviews.