From 661744d99b5f75a99a3d01bfe8654994a76c5f80 Mon Sep 17 00:00:00 2001 From: fdai7783 Date: Thu, 18 Jan 2024 22:54:50 +0100 Subject: [PATCH] Added square root functionality and one test for it --- ...ogarithmic_and_expo_and_root_calculations.py | 5 +++++ ...ogarithmic_ann_expo_and_root_calculations.py | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/main/py/logarithmic_and_expo_and_root_calculations.py create mode 100644 src/test/py/logarithmic_ann_expo_and_root_calculations.py diff --git a/src/main/py/logarithmic_and_expo_and_root_calculations.py b/src/main/py/logarithmic_and_expo_and_root_calculations.py new file mode 100644 index 0000000..8ce709c --- /dev/null +++ b/src/main/py/logarithmic_and_expo_and_root_calculations.py @@ -0,0 +1,5 @@ +import math + + +def sqr(first_number): + return math.sqrt(first_number) diff --git a/src/test/py/logarithmic_ann_expo_and_root_calculations.py b/src/test/py/logarithmic_ann_expo_and_root_calculations.py new file mode 100644 index 0000000..2cedfa0 --- /dev/null +++ b/src/test/py/logarithmic_ann_expo_and_root_calculations.py @@ -0,0 +1,17 @@ +import unittest +from src.main.py.logarithmic_and_expo_and_root_calculations import * + + +class primitive_calculations(unittest.TestCase): + def setUp(self): + pass + + def tearDown(self): + pass + + def test_sqr_of_4_equals_2(self): + self.assertEqual(sqr(4), 2) + + +if __name__ == "__main__": + unittest.main()