dondaum commented on code in PR #38961:
URL: https://github.com/apache/airflow/pull/38961#discussion_r1566850091


##########
tests/providers/google/common/hooks/test_base_google.py:
##########
@@ -98,6 +98,46 @@ def test_raise_exception_on_non_quota_exception(self):
             )
 
 
+class TestRefreshCredentialsRetry:
+    @pytest.mark.parametrize(
+        "exc, retryable",
+        [
+            (RefreshError("Other error", "test body"), False),
+            (RefreshError("Unable to acquire impersonated credentials", "test 
body"), True),
+            (ValueError(), False),
+        ],
+    )
+    def test_is_refresh_credentials_exception(self, exc, retryable):
+        assert is_refresh_credentials_exception(exc) is retryable
+
+    def test_do_nothing_on_non_error(self):
+        @hook.GoogleBaseHook.refresh_credentials_retry()
+        def func():
+            return 42
+
+        assert func(), 42

Review Comment:
   Good catch. Changed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to