Skip to content

Commit

Permalink
divide by zero case added
Browse files Browse the repository at this point in the history
  • Loading branch information
rj-codecov committed Mar 22, 2024
1 parent 5205c6b commit 98cf9b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/calculator/test_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ def test_add():
# assert Calculator.divide(1, 2) == 0.5
# assert Calculator.divide(1.0, 2.0) == 0.5
# assert Calculator.divide(0, 2.0) == 0
# assert Calculator.divide(-4, 2.0) == -2.0
# assert Calculator.divide(-4, 2.0) == -2.0

def test_divide_by_0():
assert Calculator.divide(2.0, 0) == 'Cannot divide by 0'

0 comments on commit 98cf9b8

Please sign in to comment.