Пример #1
0
def test_drivesim(cardir):
    cmd = ['donkey', 'createcar', '--path', cardir ,'--template', 'square']
    out, err, proc_id = utils.run_shell_command(cmd, timeout=10)
    cmd = ['python', 'manage.py', 'drive']
    out, err, proc_id = utils.run_shell_command(cmd, cwd = cardir)
    print(err)

    """
Пример #2
0
def test_drivesim(cardir):
    cmd = ['donkey', 'createcar', '--path', cardir ,'--template', 'square']
    out, err, proc_id = utils.run_shell_command(cmd, timeout=10)
    cmd = ['python', 'manage.py', 'drive']
    out, err, proc_id = utils.run_shell_command(cmd, cwd=cardir)
    print(err)

    if is_error(err) is True:
        print('out', out)
        print('error: ', err)
        raise ValueError(err)
Пример #3
0
def test_bad_command_fails():
    cmd = ['donkey', 'not a comand']
    out, err, proc_id = utils.run_shell_command(cmd)
    print(err)
    print(out)
    assert is_error(err) is True
Пример #4
0
def test_createcar(cardir):
    cmd = ['donkey', 'createcar', '--path', cardir]
    out, err, proc_id = utils.run_shell_command(cmd)
    assert is_error(err) is False