You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-03-30 10:57:20 -07:00
chore: Fixed flaky test_update_credential_with_tokens unittest
PiperOrigin-RevId: 786340983
This commit is contained in:
committed by
Copybara-Service
parent
70266abfc2
commit
430b82024f
@@ -132,10 +132,12 @@ class TestOAuth2CredentialUtil:
|
||||
),
|
||||
)
|
||||
|
||||
# Store the expected expiry time to avoid timing issues
|
||||
expected_expires_at = int(time.time()) + 3600
|
||||
tokens = OAuth2Token({
|
||||
"access_token": "new_access_token",
|
||||
"refresh_token": "new_refresh_token",
|
||||
"expires_at": int(time.time()) + 3600,
|
||||
"expires_at": expected_expires_at,
|
||||
"expires_in": 3600,
|
||||
})
|
||||
|
||||
@@ -143,5 +145,5 @@ class TestOAuth2CredentialUtil:
|
||||
|
||||
assert credential.oauth2.access_token == "new_access_token"
|
||||
assert credential.oauth2.refresh_token == "new_refresh_token"
|
||||
assert credential.oauth2.expires_at == int(time.time()) + 3600
|
||||
assert credential.oauth2.expires_at == expected_expires_at
|
||||
assert credential.oauth2.expires_in == 3600
|
||||
|
||||
Reference in New Issue
Block a user