clan-core/pkgs/clan-cli/tests/test_cli.py

19 lines
389 B
Python

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