diff --git a/__pycache__/simple_function.cpython-312.pyc b/__pycache__/simple_function.cpython-312.pyc new file mode 100644 index 0000000..d70dbb5 Binary files /dev/null and b/__pycache__/simple_function.cpython-312.pyc differ diff --git a/simple_function.py b/simple_function.py new file mode 100644 index 0000000..21b5013 --- /dev/null +++ b/simple_function.py @@ -0,0 +1,6 @@ +def greet(name): + """A simple function that greets the user.""" + return f"Hello, {name}!" + +if __name__ == "__main__": + print(greet("World")) diff --git a/test_simple_function.py b/test_simple_function.py new file mode 100644 index 0000000..30e43e5 --- /dev/null +++ b/test_simple_function.py @@ -0,0 +1,11 @@ +import unittest +from simple_function import greet + +class TestSimpleFunction(unittest.TestCase): + def test_greet(self): + self.assertEqual(greet("Alice"), "Hello, Alice!") + self.assertEqual(greet("Bob"), "Hello, Bob!") + self.assertEqual(greet(""), "Hello, !") + +if __name__ == "__main__": + unittest.main()