docstr: Test operator on_kill method if APIClient not created in case of error.
docstr_tok: ["Test","operator","on_kill","method","if","APIClient","not","created","in","case","of","error","."]
code: def test_on_kill_client_not_created(self, docker_api_client_patcher):
      """Test operator on_kill method if APIClient not created in case of error."""
      docker_api_client_patcher.side_effect = APIError(
          "Fake Client Error"
      )
      op = DockerSwarmOperator(image="", task_id="test_on_kill")
      mock_service = mock.MagicMock()
      op.service = mock_service
  
      with pytest.raises(APIError, match="Fake Client Error"):
          op.hook.get_conn()
      op.on_kill()
      docker_api_client_patcher.return_value.remove_service.assert_not_called()
      mock_service.assert_not_called()
  
file_path: airflow/tests/providers/docker/operators/test_docker_swarm.py
imports: from __future__ import annotations
  from unittest import mock
  import pytest
  from docker import APIClient, types
  from docker.constants import DEFAULT_TIMEOUT_SECONDS
  from docker.errors import APIError
  from airflow.exceptions import AirflowException
  from airflow.providers.docker.operators.docker_swarm import DockerSwarmOperator
label_desc: Use image node_id 6 for calling the TestDockerSwarmOperator obj's underlying member method code with example usage: obj.test_on_kill_client_not_created(docker_api_client_patcher) without return types