Ejemplo n.º 1
0
def test_check_communicate_fail_stderr_redirected():
    with pytest.raises(CalledProcessError) as excinfo:
        check_communicate(cat_stderr_exit6_sh,
                          '<input>',
                          stderr=STDOUT,
                          shell=True)
    assert excinfo.value.returncode == 6
    assert excinfo.value.output == b'<input><stderr>\n'
Ejemplo n.º 2
0
def test_check_communicate_redirect_stderr():
    assert check_communicate(cat_stderr_sh,
                             '<input>',
                             stderr=STDOUT,
                             shell=True) == b'<input><stderr>\n'
Ejemplo n.º 3
0
def test_check_communicate_simple_error():
    with pytest.raises(CalledProcessError) as excinfo:
        check_communicate('exit 28', None, shell=True)
    assert excinfo.value.returncode == 28
Ejemplo n.º 4
0
def test_check_communicate_normal():
    assert check_communicate(['cat'], '<stdin>') == b'<stdin>'