Skip to content

Commit

Permalink
✅ Added test_root_square
Browse files Browse the repository at this point in the history
  • Loading branch information
mgardzinski committed Apr 5, 2024
1 parent 1e6d955 commit f0a4fef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion calculator/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .calculator import add, subtract, divide, multiply, exponentiate
from .calculator import add, subtract, divide, multiply, exponentiate, root_square
8 changes: 7 additions & 1 deletion calculator/tests/unit_tests_calculator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# test_calculator.py

from calculator import add, multiply, divide, subtract, exponentiate
from calculator import add, multiply, divide, subtract, exponentiate, root_square


def test_addition():
Expand Down Expand Up @@ -31,3 +31,9 @@ def test_exponentiate():
assert exponentiate(2, 2) == 4
assert exponentiate(-3, 3) == -27
assert exponentiate(9, 0) == 1


def test_root_square():
assert root_square(4) == 2
assert root_square(25) == 5
assert root_square(9) == 3

0 comments on commit f0a4fef

Please sign in to comment.