From c3606567d277b62e7a7d77e192c8928a577494bf Mon Sep 17 00:00:00 2001 From: fdai7783 Date: Thu, 18 Jan 2024 21:33:28 +0100 Subject: [PATCH] Added subtraction functionality and one test for it --- src/main/py/primitive_calculations.py | 4 ++++ src/test/py/test_primitive_calculations.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/main/py/primitive_calculations.py b/src/main/py/primitive_calculations.py index 79558e7..478162b 100644 --- a/src/main/py/primitive_calculations.py +++ b/src/main/py/primitive_calculations.py @@ -1,2 +1,6 @@ def add(first_number, second_number): return first_number + second_number + + +def subract(first_number, second_number): + return second_number - first_number diff --git a/src/test/py/test_primitive_calculations.py b/src/test/py/test_primitive_calculations.py index 38f3cd6..0111dc7 100644 --- a/src/test/py/test_primitive_calculations.py +++ b/src/test/py/test_primitive_calculations.py @@ -21,6 +21,9 @@ class primitive_calculations(unittest.TestCase): def test_add_1_dot_5_plus_1_dot_5_equals_3(self): self.assertEqual(add(1.5, 1.5), 3) + def test_subtract_5_minus_5_equals_10(self): + self.assertEqual(subract(5, 5), 0) + if __name__ == "__main__": unittest.main()