code: def test_no_auto_remove(self, types_mock, docker_api_client_patcher):
      mock_obj = mock.Mock()
  
      client_mock = mock.Mock(spec=APIClient)
      client_mock.create_service.return_value = {"ID": "some_id"}
      client_mock.images.return_value = []
      client_mock.pull.return_value = [b'{"status":"pull log"}']
      client_mock.tasks.return_value = [
          {"Status": {"State": "complete"}}
      ]
      types_mock.TaskTemplate.return_value = mock_obj
      types_mock.ContainerSpec.return_value = mock_obj
      types_mock.RestartPolicy.return_value = mock_obj
      types_mock.Resources.return_value = mock_obj
  
      docker_api_client_patcher.return_value = client_mock
  
      operator = DockerSwarmOperator(
          image="",
          auto_remove="never",
          task_id="unittest",
          enable_logging=False,
      )
      operator.execute(None)
  
      assert (
          client_mock.remove_service.call_count == 0
      ), "Docker service being removed even when `auto_remove` set to `never`"
  
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 3 for calling the TestDockerSwarmOperator obj's underlying member method code with example usage: obj.test_no_auto_remove(types_mock, docker_api_client_patcher) without return types