예제 #1
0
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)
예제 #2
0
def test_run():
    from gluuapi.utils import run

    result = run("echo gluu")
    assert result.strip() == "gluu"