def test_run_error(): import subprocess from gluuapi.utils import run with pytest.raises(SystemExit): run("random-command") with pytest.raises(subprocess.CalledProcessError): run("random-command", exit_on_error=False)
def test_run(): from gluuapi.utils import run result = run("echo gluu") assert result.strip() == "gluu"