File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ def _retry_hook(retry_state: RetryCallState) -> None:
148148
149149
150150_RETRY_ARGS = {
151- "retry" : retry_if_exception_type (AuthorizationExpiredError ),
151+ "retry" : retry_if_exception_type (( AuthorizationExpiredError , UnauthorizedError ) ),
152152 "stop" : stop_after_attempt (2 ),
153153 "before_sleep" : _retry_hook ,
154154 "reraise" : True ,
Original file line number Diff line number Diff line change @@ -558,7 +558,8 @@ def test_list_namespace_with_parent_200(rest_mock: Mocker) -> None:
558558@pytest .mark .filterwarnings (
559559 "ignore:Deprecated in 0.8.0, will be removed in 1.0.0. Iceberg REST client is missing the OAuth2 server URI:DeprecationWarning"
560560)
561- def test_list_namespaces_token_expired (rest_mock : Mocker ) -> None :
561+ @pytest .mark .parametrize ("status_code" , [401 , 419 ])
562+ def test_list_namespaces_token_expired_success_on_retries (rest_mock : Mocker , status_code : int ) -> None :
562563 new_token = "new_jwt_token"
563564 new_header = dict (TEST_HEADERS )
564565 new_header ["Authorization" ] = f"Bearer { new_token } "
@@ -568,12 +569,12 @@ def test_list_namespaces_token_expired(rest_mock: Mocker) -> None:
568569 f"{ TEST_URI } v1/namespaces" ,
569570 [
570571 {
571- "status_code" : 419 ,
572+ "status_code" : status_code ,
572573 "json" : {
573574 "error" : {
574575 "message" : "Authorization expired." ,
575576 "type" : "AuthorizationExpiredError" ,
576- "code" : 419 ,
577+ "code" : status_code ,
577578 }
578579 },
579580 "headers" : TEST_HEADERS ,
You can’t perform that action at this time.
0 commit comments