Merge pull request 'templates: add python-project' (#10) from python-template into main
This commit is contained in:
16
templates/python-project/tests/test_cli.py
Normal file
16
templates/python-project/tests/test_cli.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import sys
|
||||
|
||||
import my_tool
|
||||
|
||||
|
||||
def test_no_args(capsys):
|
||||
my_tool.my_cli()
|
||||
captured = capsys.readouterr()
|
||||
assert captured.out.startswith("usage:")
|
||||
|
||||
|
||||
def test_version(capsys, monkeypatch):
|
||||
monkeypatch.setattr(sys, "argv", ["", "--version"])
|
||||
my_tool.my_cli()
|
||||
captured = capsys.readouterr()
|
||||
assert captured.out.startswith("Version:")
|
||||
Reference in New Issue
Block a user