summaryrefslogtreecommitdiffstats
path: root/contrib/python/google-auth/py3/tests/test__default.py
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2024-11-21 11:14:32 +0300
committerrobot-piglet <[email protected]>2024-11-21 11:23:42 +0300
commited5b11df0064bcf6ef0d03aa0f1a34f4aa97851d (patch)
tree89842a7525bcc7f2809cbbc4360f6394d0ef929b /contrib/python/google-auth/py3/tests/test__default.py
parent532123792431edd487519a254f2248603c2056e7 (diff)
Intermediate changes
commit_hash:9085ddac9f80e60b5b938027d444ed98e80ef95a
Diffstat (limited to 'contrib/python/google-auth/py3/tests/test__default.py')
-rw-r--r--contrib/python/google-auth/py3/tests/test__default.py16
1 files changed, 16 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 3147d505dab..f71594fcc5e 100644
--- a/contrib/python/google-auth/py3/tests/test__default.py
+++ b/contrib/python/google-auth/py3/tests/test__default.py
@@ -154,6 +154,11 @@ IMPERSONATED_SERVICE_ACCOUNT_SERVICE_ACCOUNT_SOURCE_FILE = os.path.join(
DATA_DIR, "impersonated_service_account_service_account_source.json"
)
+IMPERSONATED_SERVICE_ACCOUNT_EXTERNAL_ACCOUNT_AUTHORIZED_USER_SOURCE_FILE = os.path.join(
+ DATA_DIR,
+ "impersonated_service_account_external_account_authorized_user_source.json",
+)
+
EXTERNAL_ACCOUNT_AUTHORIZED_USER_FILE = os.path.join(
DATA_DIR, "external_account_authorized_user.json"
)
@@ -366,6 +371,17 @@ def test_load_credentials_from_file_impersonated_with_service_account_source():
assert not credentials._quota_project_id
+def test_load_credentials_from_file_impersonated_with_external_account_authorized_user_source():
+ credentials, _ = _default.load_credentials_from_file(
+ IMPERSONATED_SERVICE_ACCOUNT_EXTERNAL_ACCOUNT_AUTHORIZED_USER_SOURCE_FILE
+ )
+ assert isinstance(credentials, impersonated_credentials.Credentials)
+ assert isinstance(
+ credentials._source_credentials, external_account_authorized_user.Credentials
+ )
+ assert not credentials._quota_project_id
+
+
def test_load_credentials_from_file_impersonated_passing_quota_project():
credentials, _ = _default.load_credentials_from_file(
IMPERSONATED_SERVICE_ACCOUNT_SERVICE_ACCOUNT_SOURCE_FILE,