Skip to content

Commit b2dd77f

Browse files
fix: fix the scopes so test can pass for a local run (#450)
1 parent 31299e2 commit b2dd77f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

system_tests/test_oauth2_credentials.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ def test_refresh(authorized_user_file, http_request, token_info):
4242

4343
# Canonical list of scopes at https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login
4444
# or do `gcloud auth application-defaut login --help`
45-
assert set(info_scopes) == set(
45+
canonical_scopes = set(
4646
[
4747
"https://www.googleapis.com/auth/userinfo.email",
4848
"https://www.googleapis.com/auth/cloud-platform",
4949
"openid",
5050
]
5151
)
52+
# When running the test locally, we always have an additional "accounts.reauth" scope.
53+
canonical_scopes_with_reauth = canonical_scopes.copy()
54+
canonical_scopes_with_reauth.add("https://www.googleapis.com/auth/accounts.reauth")
55+
assert set(info_scopes) == canonical_scopes or set(info_scopes) == canonical_scopes_with_reauth

0 commit comments

Comments
 (0)