Example #1
0
def test_authentication_error(auth):
    """Tests authentication errors"""
    auth = Authentication('test_error')
    assert not auth.errors
    assert not auth.get_token()
    assert auth.errors
    assert not auth.token
Example #2
0
def test_api_get_usage(auth):
    """Tests authentication api_get_usage method"""
    assert auth.get_usage()
    new_auth = Authentication(os.getenv("TEST_AIRBUS_API_KEY"))
    assert new_auth.get_usage()
    assert new_auth.token
    assert not new_auth.errors
Example #3
0
def auth():
    """Sample pytest fixture.

    See more at: http://doc.pytest.org/en/latest/fixture.html
    """
    return Authentication(os.getenv("TEST_AIRBUS_API_KEY"))