SXXXXXXX_PyUCC/tests/test_main_cli.py

15 lines
435 B
Python

import sys
from pathlib import Path
import pyucc.__main__ as mainmod
def test_main_cli_non_gui(tmp_path, monkeypatch, capsys):
# create a dummy directory to pass as argument
d = tmp_path / "dirA"
d.mkdir()
monkeypatch.setattr(sys, "argv", ["pyucc", str(d)])
# should not raise and should print starting analysis
mainmod.main()
captured = capsys.readouterr()
assert "Starting analysis" in captured.out