Beispiel #1
0
def test_ok_with_callback():
    msg = ['']

    def callback(m):
        msg[0] = m

    run_cmd('echo hola', stdout_callback=callback)
    assert msg[0] == 'hola\n'
Beispiel #2
0
 def run_helper(cmd, env=None):
     try:
         logging.debug('Running cmd: {}'.format(cmd))
         return run_cmd(cmd,
                        env=env,
                        stdout_callback=None,
                        stderr_callback=None)
     except CmdException:
         raise
Beispiel #3
0
 def run_helper(cmd, env=None):
     try:
         logging.debug('Running cmd: {}'.format(cmd))
         return run_cmd(cmd,
                        env=env,
                        stdout_callback=None,
                        stderr_callback=None)
     except CmdException:
         raise
Beispiel #4
0
def test_ok():
    run_cmd('ls')
Beispiel #5
0
def test_fail():
    with pytest.raises(CmdException):
        run_cmd('dfasdfad')