Ejemplo n.º 1
0
def test_login_error(client, login_failure):
    with pytest.raises(exceptions.BetfairLoginError) as excinfo:
        client.login('name', 'wrong')
    error = excinfo.value
    assert error.message == 'INVALID_USERNAME_OR_PASSWORD'
Ejemplo n.º 2
0
def test_login_bad_code(client, login_bad_code):
    with pytest.raises(exceptions.ApiError) as excinfo:
        client.login('name', 'wrong')
    error = excinfo.value
    assert error.status_code == 422
    assert error.message == 'UNKNOWN'
Ejemplo n.º 3
0
def test_login_success(client, login_success):
    client.login('name', 'pass')
    assert client.session_token == 'secret'
Ejemplo n.º 4
0
def test_login_error(client, login_failure):
    with pytest.raises(exceptions.LoginError) as excinfo:
        client.login('name', 'wrong')
    error = excinfo.value
    assert error.message == 'INVALID_USERNAME_OR_PASSWORD'
Ejemplo n.º 5
0
def test_login_success(client, login_success):
    client.login('name', 'pass')
    assert client.session_token == 'secret'
Ejemplo n.º 6
0
def test_login_bad_code(client, login_bad_code):
    with pytest.raises(exceptions.ApiError) as excinfo:
        client.login("name", "wrong")
    error = excinfo.value
    assert error.status_code == 422
    assert error.message == "UNKNOWN"
Ejemplo n.º 7
0
def test_login_error(client, login_failure):
    with pytest.raises(exceptions.LoginError) as excinfo:
        client.login("name", "wrong")
    error = excinfo.value
    assert error.message == "INVALID_USERNAME_OR_PASSWORD"
Ejemplo n.º 8
0
def test_login_success(client, login_success):
    client.login("name", "pass")
    assert client.session_token == "secret"