feat: add greet CLI with tests
This commit is contained in:
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
10
tests/test_cli.py
Normal file
10
tests/test_cli.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from click.testing import CliRunner
|
||||
|
||||
from py_demo.cli import main
|
||||
|
||||
|
||||
def test_greet_outputs_hello():
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(main, ["greet", "World"])
|
||||
assert result.exit_code == 0
|
||||
assert "Hello, World!" in result.output
|
||||
Reference in New Issue
Block a user