✅ Add first test, scaffold testing
This commit is contained in:
parent
eff740c844
commit
a3d337f98b
4 changed files with 13 additions and 0 deletions
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
0
tests/test_tutorial/__init__.py
Normal file
0
tests/test_tutorial/__init__.py
Normal file
0
tests/test_tutorial/test_first_steps/__init__.py
Normal file
0
tests/test_tutorial/test_first_steps/__init__.py
Normal file
13
tests/test_tutorial/test_first_steps/test_tutorial001.py
Normal file
13
tests/test_tutorial/test_first_steps/test_tutorial001.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from typer.testing import CliRunner
|
||||
import typer
|
||||
|
||||
from first_steps.tutorial001 import main
|
||||
|
||||
runner = CliRunner()
|
||||
|
||||
|
||||
def test_cli():
|
||||
app = typer.Typer()
|
||||
app.command()(main)
|
||||
result = runner.invoke(app, [])
|
||||
assert result.output == "Hello World\n"
|
Loading…
Reference in a new issue