Private
Public Access
1
0

passing test_imports

This commit is contained in:
Sander Roosendaal
2023-02-11 17:48:39 +01:00
parent def98b9a85
commit 3a82d91d2a
4 changed files with 12 additions and 7 deletions

View File

@@ -128,13 +128,17 @@ class SyncIntegration(metaclass=ABCMeta):
try:
expires_in = token_json['expires_in']
except KeyError: # pragma: no cover
expires_in = 0
try:
expires_at = arrow.get(token_json['expires_at']).timestamp()
expires_in = expires_at - arrow.now().timestamp()
except KeyError: # pragma: no cover
expires_in = 0
try:
expires_in = int(expires_in)
except (ValueError, TypeError): # pragma: no cover
expires_in = 0
else: # pragma: no cover
raise NoTokenError("Failed to obtain token")
else: # pragma: no cover
raise NoTokenError("Failed to obtain token")
return [thetoken, expires_in, refresh_token]