diff --git a/.gitignore b/.gitignore index a9dedaa..ec0a770 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dist/ build/ .venv/ .pytest_cache/ +specs/ diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/hello.py b/src/hello.py new file mode 100644 index 0000000..3c2df23 --- /dev/null +++ b/src/hello.py @@ -0,0 +1,3 @@ +def hello(name: str) -> str: + """Return a greeting string for the given name.""" + return f"Hello, {name}!" diff --git a/tests/test_hello.py b/tests/test_hello.py new file mode 100644 index 0000000..6c0e62a --- /dev/null +++ b/tests/test_hello.py @@ -0,0 +1,13 @@ +from src.hello import hello + + +def test_hello_world() -> None: + assert hello("World") == "Hello, World!" + + +def test_hello_empty() -> None: + assert hello("") == "Hello, !" + + +def test_hello_alice() -> None: + assert hello("Alice") == "Hello, Alice!"