Beispiel #1
0
def test_get_user_account_credentials_bad_file_returns_credentials():
    from google.auth.credentials import Credentials

    with mock.patch("__main__.open", side_effect=IOError()):
        credentials = auth.get_user_account_credentials(
            try_credentials=auth._try_credentials)
    assert isinstance(credentials, Credentials)
Beispiel #2
0
def test_get_user_account_credentials_returns_credentials(project_id):
    from google.auth.credentials import Credentials

    credentials = auth.get_user_account_credentials(
        project_id=project_id,
        auth_local_webserver=True,
        try_credentials=auth._try_credentials,
    )
    assert isinstance(credentials, Credentials)