Skip to content

Commit

Permalink
Merge pull request #8 from Adal3n3/step3
Browse files Browse the repository at this point in the history
step3: cover divide by 0 case
  • Loading branch information
Adal3n3 authored Apr 23, 2024
2 parents ee98986 + 3c01a7b commit f0a9d69
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_divide():
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 f0a9d69

Please sign in to comment.