Skip to content

Commit ee815a0

Browse files
committed
Issue #237 python3.6 compatibilty fix
1 parent 0b2f7de commit ee815a0

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

openeo/rest/auth/oidc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ def get_tokens(self, request_refresh_token: bool = False) -> AccessTokenResult:
860860
error = resp.json()["error"]
861861
except Exception:
862862
error = "unknown"
863-
log.info(f"[{elapsed():5.1f}s] not authorized yet: {error=}")
863+
log.info(f"[{elapsed():5.1f}s] not authorized yet: {error}")
864864
if error == "authorization_pending":
865865
poll_ui.show_progress(status="Authorization pending")
866866
elif error == "slow_down":

tests/rest/auth/test_oidc.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,7 @@ def test_oidc_device_flow_with_client_secret(requests_mock, caplog, support_veri
411411
(1011, "", "\n"),
412412
]
413413

414-
assert re.search(
415-
r"error='authorization_pending'.*error='slow_down'.*Authorized successfully", caplog.text, flags=re.DOTALL
416-
)
414+
assert re.search(r"authorization_pending.*slow_down.*Authorized successfully", caplog.text, flags=re.DOTALL)
417415

418416

419417
@pytest.mark.parametrize("support_verification_uri_complete", [False, True])
@@ -482,7 +480,7 @@ def test_oidc_device_flow_with_pkce(requests_mock, caplog, support_verification_
482480
]
483481

484482
assert re.search(
485-
r"error='authorization_pending'.*error='authorization_pending'.*Authorized successfully",
483+
r"authorization_pending.*authorization_pending.*Authorized successfully",
486484
caplog.text,
487485
flags=re.DOTALL,
488486
)
@@ -558,9 +556,7 @@ def test_oidc_device_flow_without_pkce_nor_secret(
558556
(1043.5, "", "\n"),
559557
]
560558

561-
assert re.search(
562-
r"error='authorization_pending'.*error='slow_down'.*Authorized successfully", caplog.text, flags=re.DOTALL
563-
)
559+
assert re.search(r"authorization_pending.*slow_down.*Authorized successfully", caplog.text, flags=re.DOTALL)
564560

565561

566562
@pytest.mark.parametrize(["mode", "client_id", "use_pkce", "client_secret", "expected_fields"], [
@@ -682,9 +678,7 @@ def test_oidc_device_flow_auto_detect(
682678
(1033, "", "\n"),
683679
]
684680

685-
assert re.search(
686-
r"error='authorization_pending'.*error='slow_down'.*Authorized successfully", caplog.text, flags=re.DOTALL
687-
)
681+
assert re.search(r"authorization_pending.*slow_down.*Authorized successfully", caplog.text, flags=re.DOTALL)
688682

689683

690684
def test_oidc_refresh_token_flow(requests_mock, caplog):

0 commit comments

Comments
 (0)