Dr-Denzy commented on a change in pull request #15617:
URL: https://github.com/apache/airflow/pull/15617#discussion_r624754291
##########
File path: tests/executors/test_kubernetes_executor.py
##########
@@ -120,6 +119,71 @@ def test_execution_date_serialize_deserialize(self):
assert datetime_obj == new_datetime_obj
+ @unittest.skipIf(AirflowKubernetesScheduler is None, 'kubernetes python
package is not installed')
+ @mock.patch('airflow.executors.kubernetes_executor.get_kube_client')
+ @mock.patch('airflow.executors.kubernetes_executor.client')
+ @mock.patch('airflow.executors.kubernetes_executor.KubernetesJobWatcher')
+ def test_delete_pod_successfully(
+ self, mock_watcher, mock_client, mock_kube_client
+ ): # pylint: disable=unused-argument
+ pod_id = "my-pod-1"
+ namespace = "my-namespace"
+
+ kube_client = mock.MagicMock()
+ mock_kube_client.return_value.delete_namespaced_pod = kube_client
Review comment:
> This feels weird, why would
`mock_kube_client.return_value.delete_namespaced_pod` be equal to `kube_client`
?
Hmm... I will change the mock object naming.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]