clan-core/pkgs/clan-cli/tests/test_cli.py
DavHau e806b5549d
Some checks failed
build / test (push) Failing after 8s
clan-cli: enable mypy for tests
2023-07-21 13:43:29 +02:00

19 lines
452 B
Python

import sys
import clan_cli
import pytest
def test_no_args(capsys):
clan_cli.main()
captured = capsys.readouterr()
assert captured.out.startswith("usage:")
def test_help(capsys: pytest.CaptureFixture, monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setattr(sys, "argv", ["", "--help"])
with pytest.raises(SystemExit):
clan_cli.main()
captured = capsys.readouterr()
assert captured.out.startswith("usage:")