Exemplo n.º 1
0
def test_run_stderr():
    """
    Run a process and capture stdout
    """
    pytest.dbgfunc()
    r = tbx.run("ls --nosuch")
    assert "ERR:" in r
    assert re.findall("(illegal|unrecognized) option", r)
Exemplo n.º 2
0
def test_run_fail():
    """
    Run a binary that doesn't exist
    """
    pytest.dbgfunc()
    r = tbx.run("nosuchbinary")
    assert "ERR:" in r
    assert "No such file or directory" in r
Exemplo n.º 3
0
def test_run_stdout():
    """
    Run a process and capture stdout
    """
    pytest.dbgfunc()
    r = tbx.run('python -c "import this"')
    assert "Zen of Python" in r
    assert "Namespaces" in r