clan-core/pkgs/clan-cli/tests/test_cli.py
DavHau 9906d12384 clan-cli: initialize python project from template
clan-cli: remove unnecessary unit test file

clan-cli: fix shell.nix too stateful

clan-cli: remove conftest.py

clan-cli: fix flake-module.nix
2023-07-21 11:19:03 +02:00

17 lines
356 B
Python

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:")