hussein-awala commented on code in PR #29809:
URL: https://github.com/apache/airflow/pull/29809#discussion_r1125695860


##########
tests/kubernetes/test_client.py:
##########
@@ -78,3 +80,23 @@ def test_disable_verify_ssl(self):
         else:
             configuration = Configuration()
         assert not configuration.verify_ssl
+
+    def test_api_client_retry_configuration_default(self):
+        conf = initialize_config()
+        api_client_retry_configuration = conf.getjson(
+            "kubernetes", "api_client_retry_configuration", fallback={}
+        )
+
+        assert api_client_retry_configuration == {}
+
+    @mock.patch("airflow.kubernetes.kube_client.conf")
+    @conf_vars({("kubernetes", "api_client_retry_configuration"): '{"total": 
3, "backoff_factor": 0.5}'})
+    def test_api_client_retry_configuration_correct_values(self, conf):
+        get_kube_client(in_cluster=False)
+        conf.getboolean.assert_called_with("kubernetes", 
"api_client_retry_configuration")
+
+        api_client_retry_configuration = conf.getjson(
+            "kubernetes", "api_client_retry_configuration", fallback={}
+        )
+
+        assert api_client_retry_configuration == {"total": 3, 
"backoff_factor": 0.5}

Review Comment:
   This line patches the class `InClusterConfigLoader` (which is used to load 
k8s config when in_cluster is True) and replaces it by a mock.
   You can check the mock 
[documentation](https://docs.python.org/3/library/unittest.mock.html#the-patchers)
 for more info.



-- 
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