From f0a4fefb233439e2de26364367ae9e96aaa11cc8 Mon Sep 17 00:00:00 2001 From: mgardzinski Date: Fri, 5 Apr 2024 11:14:06 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Added=20`test=5Froot=5Fsquare`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- calculator/__init__.py | 2 +- calculator/tests/unit_tests_calculator.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/calculator/__init__.py b/calculator/__init__.py index 1c71c71..3a66ee4 100644 --- a/calculator/__init__.py +++ b/calculator/__init__.py @@ -1 +1 @@ -from .calculator import add, subtract, divide, multiply, exponentiate +from .calculator import add, subtract, divide, multiply, exponentiate, root_square diff --git a/calculator/tests/unit_tests_calculator.py b/calculator/tests/unit_tests_calculator.py index b9913fa..2f11441 100644 --- a/calculator/tests/unit_tests_calculator.py +++ b/calculator/tests/unit_tests_calculator.py @@ -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(): @@ -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