Skip to content

Commit fb3c4f1

Browse files
chore(auth): unblock tests (#16481)
Fix failing system tests, related to empty tokens ~Also added back [scipts from split repo](https://github.com/googleapis/google-auth-library-python/tree/main/scripts), which were used to set up system tests. These scripts are referenced in CONTRIBUTING.md~ --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 23f81cd commit fb3c4f1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/google-auth/system_tests/system_tests_sync/test_external_accounts.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ def dns_access_direct(request, project_id):
6565

6666
# Apply the default credentials to the headers to make the request.
6767
headers = {}
68-
credentials.apply(headers)
68+
url = "https://dns.googleapis.com/dns/v1/projects/{}".format(project_id)
69+
credentials.before_request(request, "GET", url, headers)
6970
response = request(
70-
url="https://dns.googleapis.com/dns/v1/projects/{}".format(project_id),
71+
url=url,
7172
headers=headers,
7273
)
7374

@@ -213,6 +214,8 @@ def check_impersonation_expiration():
213214
request=http_request,
214215
)
215216

217+
credentials.refresh(http_request)
218+
216219
utcmax = _helpers.utcnow() + datetime.timedelta(seconds=TOKEN_LIFETIME_SECONDS)
217220
utcmin = utcmax - datetime.timedelta(seconds=BUFFER_SECONDS)
218221
assert utcmin < credentials._impersonated_credentials.expiry <= utcmax

0 commit comments

Comments
 (0)