diff options
| author | robot-piglet <[email protected]> | 2024-01-26 13:18:00 +0300 | 
|---|---|---|
| committer | robot-piglet <[email protected]> | 2024-01-26 14:37:14 +0300 | 
| commit | 7e48de06a66dff1e3f73e186f64b6d155dffa086 (patch) | |
| tree | edd6494ecf7cfca5285dbf4e5c386a20ab58e970 /contrib/python/google-auth/py3/tests/test__default.py | |
| parent | 9b8da54607431b12327615568180adf77cca95c8 (diff) | |
Intermediate changes
Diffstat (limited to 'contrib/python/google-auth/py3/tests/test__default.py')
| -rw-r--r-- | contrib/python/google-auth/py3/tests/test__default.py | 13 | 
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/python/google-auth/py3/tests/test__default.py b/contrib/python/google-auth/py3/tests/test__default.py index d619614790c..aaf892f6d04 100644 --- a/contrib/python/google-auth/py3/tests/test__default.py +++ b/contrib/python/google-auth/py3/tests/test__default.py @@ -158,6 +158,10 @@ EXTERNAL_ACCOUNT_AUTHORIZED_USER_FILE = os.path.join(      DATA_DIR, "external_account_authorized_user.json"  ) +EXTERNAL_ACCOUNT_AUTHORIZED_USER_NON_GDU_FILE = os.path.join( +    DATA_DIR, "external_account_authorized_user_non_gdu.json" +) +  MOCK_CREDENTIALS = mock.Mock(spec=credentials.CredentialsWithQuotaProject)  MOCK_CREDENTIALS.with_quota_project.return_value = MOCK_CREDENTIALS @@ -577,6 +581,15 @@ def test_load_credentials_from_file_external_account_authorized_user():      assert project_id is None +def test_load_credentials_from_file_external_account_authorized_user_non_gdu(): +    credentials, _ = _default.load_credentials_from_file( +        EXTERNAL_ACCOUNT_AUTHORIZED_USER_NON_GDU_FILE, request=mock.sentinel.request +    ) + +    assert isinstance(credentials, external_account_authorized_user.Credentials) +    assert credentials.universe_domain == "fake_universe_domain" + +  def test_load_credentials_from_file_external_account_authorized_user_bad_format(tmpdir):      filename = tmpdir.join("external_account_authorized_user_bad.json")      filename.write(json.dumps({"type": "external_account_authorized_user"}))  | 
