Exemplo n.º 1
0
 def test_spawned_process_error_nostderr(self):
     exc_args = ('foo bar', 'partial output', '', 1)
     e = exc.SpawnedProcessError(*exc_args)
     self.assertRaisesRegex(
         exc.ReframeError, r"command 'foo bar' failed with exit code 1:\n"
         r"=== STDOUT ===\n"
         r'partial output\n'
         r"=== STDERR ===", raise_exc, e)
Exemplo n.º 2
0
 def test_spawned_process_error_nostdout(self):
     exc_args = ('foo bar', '', 'error message', 1)
     e = exc.SpawnedProcessError(*exc_args)
     self.assertRaisesRegex(
         exc.ReframeError, r"command 'foo bar' failed with exit code 1:\n"
         r"=== STDOUT ===\n"
         r"=== STDERR ===\n"
         r"error message", raise_exc, e)
Exemplo n.º 3
0
def test_spawned_process_error_nostderr():
    exc_args = ('foo bar', 'partial output', '', 1)
    e = exc.SpawnedProcessError(*exc_args)
    with pytest.raises(exc.ReframeError,
                       match=(r"command 'foo bar' failed with exit code 1:\n"
                              r"=== STDOUT ===\n"
                              r'partial output\n'
                              r"=== STDERR ===")):
        raise e
Exemplo n.º 4
0
def test_spawned_process_error_nostdout():
    exc_args = ('foo bar', '', 'error message', 1)
    e = exc.SpawnedProcessError(*exc_args)
    with pytest.raises(exc.ReframeError,
                       match=(r"command 'foo bar' failed with exit code 1:\n"
                              r"=== STDOUT ===\n"
                              r"=== STDERR ===\n"
                              r"error message")):
        raise e
Exemplo n.º 5
0
def test_spawned_process_error_list_args():
    exc_args = (['foo', 'bar'], 'partial output', 'error message', 1)
    e = exc.SpawnedProcessError(*exc_args)
    with pytest.raises(exc.ReframeError,
                       match=(r"command 'foo bar' failed with exit code 1:\n"
                              r"=== STDOUT ===\n"
                              r'partial output\n'
                              r"=== STDERR ===\n"
                              r"error message")):
        raise e

    assert exc_args == e.args
Exemplo n.º 6
0
def test_spawned_process_error():
    exc_args = ('foo bar', 'partial output', 'error message', 1)
    e = exc.SpawnedProcessError(*exc_args)
    with pytest.raises(exc.ReframeError,
                       match=(r"command 'foo bar' failed with exit code 1:\n"
                              r"--- stdout ---\n"
                              r'partial output\n'
                              r"--- stdout ---\n"
                              r"--- stderr ---\n"
                              r"error message\n"
                              r"--- stderr ---")):
        raise e

    assert exc_args == e.args