From b2dd77fe4a538e1d165fc9d859c9a299f6832cda Mon Sep 17 00:00:00 2001 From: arithmetic1728 <58957152+arithmetic1728@users.noreply.github.com> Date: Fri, 6 Mar 2020 13:32:21 -0800 Subject: [PATCH] fix: fix the scopes so test can pass for a local run (#450) --- system_tests/test_oauth2_credentials.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system_tests/test_oauth2_credentials.py b/system_tests/test_oauth2_credentials.py index 663d4fc21..908db3145 100644 --- a/system_tests/test_oauth2_credentials.py +++ b/system_tests/test_oauth2_credentials.py @@ -42,10 +42,14 @@ def test_refresh(authorized_user_file, http_request, token_info): # Canonical list of scopes at https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login # or do `gcloud auth application-defaut login --help` - assert set(info_scopes) == set( + canonical_scopes = set( [ "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/cloud-platform", "openid", ] ) + # When running the test locally, we always have an additional "accounts.reauth" scope. + canonical_scopes_with_reauth = canonical_scopes.copy() + canonical_scopes_with_reauth.add("https://www.googleapis.com/auth/accounts.reauth") + assert set(info_scopes) == canonical_scopes or set(info_scopes) == canonical_scopes_with_reauth