From 5bfb1483dc6aca70a0ec0f8f71f01fb0ee485245 Mon Sep 17 00:00:00 2001 From: fdai7763 Date: Tue, 23 Jan 2024 20:04:14 +0100 Subject: [PATCH] added test for returning a single constant as well as corresponding functionality --- src/main/py/read_math_function.py | 3 +++ src/test/py/test_read_math_function.py | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/main/py/read_math_function.py create mode 100644 src/test/py/test_read_math_function.py diff --git a/src/main/py/read_math_function.py b/src/main/py/read_math_function.py new file mode 100644 index 0000000..113c740 --- /dev/null +++ b/src/main/py/read_math_function.py @@ -0,0 +1,3 @@ +def read_constant(type, value): + result = value + return result \ No newline at end of file diff --git a/src/test/py/test_read_math_function.py b/src/test/py/test_read_math_function.py new file mode 100644 index 0000000..b17343d --- /dev/null +++ b/src/test/py/test_read_math_function.py @@ -0,0 +1,10 @@ +import unittest +from src.main.py.read_math_function import * + + +class read_function(unittest.TestCase): + def test_constant_without_calculation(self): + self.assertEqual(read_constant("c", 42), 42) + +if __name__ == '__main__': + unittest.main()