eladkal commented on code in PR #44357:
URL: https://github.com/apache/airflow/pull/44357#discussion_r1929937019


##########
providers/tests/cncf/kubernetes/operators/test_pod.py:
##########
@@ -1549,6 +1571,95 @@ def test_execute_sync_callbacks(self, find_pod_mock):
             "client": k.client,
             "mode": ExecutionMode.SYNC,
             "pod": k.pod,
+            "operator": k,
+            "context": context,
+        }
+
+    @patch(HOOK_CLASS, new=MagicMock)
+    @patch(KUB_OP_PATH.format("find_pod"))
+    def test_execute_sync_multiple_callbacks(self, find_pod_mock):
+        from airflow.providers.cncf.kubernetes.callbacks import ExecutionMode
+
+        from providers.tests.cncf.kubernetes.test_callbacks import (
+            MockKubernetesPodOperatorCallback,
+            MockWrapper,
+        )
+
+        MockWrapper.reset()
+        mock_callbacks = MockWrapper.mock_callbacks
+        found_pods = [MagicMock(), MagicMock(), MagicMock()]
+        find_pod_mock.side_effect = [None] + found_pods
+
+        remote_pod_mock = MagicMock()
+        remote_pod_mock.status.phase = "Succeeded"
+        self.await_pod_mock.return_value = remote_pod_mock
+        k = KubernetesPodOperator(
+            namespace="default",
+            image="ubuntu:16.04",
+            cmds=["bash", "-cx"],
+            arguments=["echo 10"],
+            labels={"foo": "bar"},
+            name="test",
+            task_id="task",
+            do_xcom_push=False,
+            callbacks=[MockKubernetesPodOperatorCallback, 
MockKubernetesPodOperatorCallback]

Review Comment:
   ```suggestion
               callbacks=[MockKubernetesPodOperatorCallback, 
MockKubernetesPodOperatorCallback],
   ```



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