2023-07-20 16:07:27 +00:00
|
|
|
import sys
|
|
|
|
|
2023-07-21 00:01:39 +00:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
import clan
|
2023-07-20 16:07:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_no_args(capsys):
|
2023-07-21 00:01:39 +00:00
|
|
|
clan.clan()
|
2023-07-20 16:07:27 +00:00
|
|
|
captured = capsys.readouterr()
|
|
|
|
assert captured.out.startswith("usage:")
|
|
|
|
|
|
|
|
|
2023-07-21 00:01:39 +00:00
|
|
|
def test_help(capsys, monkeypatch):
|
|
|
|
monkeypatch.setattr(sys, "argv", ["", "--help"])
|
|
|
|
with pytest.raises(SystemExit):
|
|
|
|
clan.clan()
|
2023-07-20 16:07:27 +00:00
|
|
|
captured = capsys.readouterr()
|
2023-07-21 00:01:39 +00:00
|
|
|
assert captured.out.startswith("usage:")
|