code: def setup_test_cases(
      self, mocked_batch_service_client, create_mock_connections
  ):
      # set up mocked Azure Batch client
      self.batch_client = mock.MagicMock(name="FakeBatchServiceClient")
      mocked_batch_service_client.return_value = self.batch_client
  
      # set up the test variable
      self.test_vm_conn_id = "test_azure_batch_vm2"
      self.test_cloud_conn_id = "test_azure_batch_cloud2"
      self.test_account_name = "test_account_name"
      self.test_account_key = "test_account_key"
      self.test_account_url = "http://test-endpoint:29000"
      self.test_vm_size = "test-vm-size"
      self.test_vm_publisher = "test.vm.publisher"
      self.test_vm_offer = "test.vm.offer"
      self.test_vm_sku = "test-sku"
      self.test_cloud_os_family = "test-family"
      self.test_cloud_os_version = "test-version"
      self.test_node_agent_sku = "test-node-agent-sku"
  
      create_mock_connections(
          # connect with vm configuration
          Connection(
              conn_id=self.test_vm_conn_id,
              conn_type="azure_batch",
              extra=json.dumps({"account_url": self.test_account_url}),
          ),
          # connect with cloud service
          Connection(
              conn_id=self.test_cloud_conn_id,
              conn_type="azure_batch",
              extra=json.dumps({"account_url": self.test_account_url}),
          ),
      )
  
      self.operator = AzureBatchOperator(
          task_id=TASK_ID,
          batch_pool_id=BATCH_POOL_ID,
          batch_pool_vm_size=BATCH_VM_SIZE,
          batch_job_id=BATCH_JOB_ID,
          batch_task_id=BATCH_TASK_ID,
          vm_publisher=self.test_vm_publisher,
          vm_offer=self.test_vm_offer,
          vm_sku=self.test_vm_sku,
          vm_node_agent_sku_id=self.test_node_agent_sku,
          sku_starts_with=self.test_vm_sku,
          batch_task_command_line="echo hello",
          azure_batch_conn_id=self.test_vm_conn_id,
          target_dedicated_nodes=1,
          timeout=2,
      )
      self.operator2_pass = AzureBatchOperator(
          task_id=TASK_ID,
          batch_pool_id=BATCH_POOL_ID,
          batch_pool_vm_size=BATCH_VM_SIZE,
          batch_job_id=BATCH_JOB_ID,
          batch_task_id=BATCH_TASK_ID,
          vm_node_agent_sku_id=self.test_node_agent_sku,
          os_family="4",
          batch_task_command_line="echo hello",
          azure_batch_conn_id=self.test_vm_conn_id,
          enable_auto_scale=True,
          auto_scale_formula=FORMULA,
          timeout=2,
      )
      self.operator2_no_formula = AzureBatchOperator(
          task_id=TASK_ID,
          batch_pool_id=BATCH_POOL_ID,
          batch_pool_vm_size=BATCH_VM_SIZE,
          batch_job_id=BATCH_JOB_ID,
          batch_task_id=BATCH_TASK_ID,
          vm_node_agent_sku_id=self.test_node_agent_sku,
          os_family="4",
          batch_task_command_line="echo hello",
          azure_batch_conn_id=self.test_vm_conn_id,
          enable_auto_scale=True,
          timeout=2,
      )
      self.operator_fail = AzureBatchOperator(
          task_id=TASK_ID,
          batch_pool_id=BATCH_POOL_ID,
          batch_pool_vm_size=BATCH_VM_SIZE,
          batch_job_id=BATCH_JOB_ID,
          batch_task_id=BATCH_TASK_ID,
          vm_node_agent_sku_id=self.test_node_agent_sku,
          os_family="4",
          batch_task_command_line="echo hello",
          azure_batch_conn_id=self.test_vm_conn_id,
          timeout=2,
      )
      self.operator_mutual_exclusive = AzureBatchOperator(
          task_id=TASK_ID,
          batch_pool_id=BATCH_POOL_ID,
          batch_pool_vm_size=BATCH_VM_SIZE,
          batch_job_id=BATCH_JOB_ID,
          batch_task_id=BATCH_TASK_ID,
          vm_publisher=self.test_vm_publisher,
          vm_offer=self.test_vm_offer,
          vm_sku=self.test_vm_sku,
          vm_node_agent_sku_id=self.test_node_agent_sku,
          os_family="5",
          sku_starts_with=self.test_vm_sku,
          batch_task_command_line="echo hello",
          azure_batch_conn_id=self.test_vm_conn_id,
          target_dedicated_nodes=1,
          timeout=2,
      )
      self.operator_invalid = AzureBatchOperator(
          task_id=TASK_ID,
          batch_pool_id=BATCH_POOL_ID,
          batch_pool_vm_size=BATCH_VM_SIZE,
          batch_job_id=BATCH_JOB_ID,
          batch_task_id=BATCH_TASK_ID,
          vm_node_agent_sku_id=self.test_node_agent_sku,
          batch_task_command_line="echo hello",
          azure_batch_conn_id=self.test_vm_conn_id,
          target_dedicated_nodes=1,
          timeout=2,
      )
  
file_path: airflow/tests/providers/microsoft/azure/operators/test_batch.py
imports: from __future__ import annotations
  import json
  from unittest import mock
  import pytest
  from airflow.exceptions import AirflowException
  from airflow.models import Connection
  from airflow.providers.microsoft.azure.hooks.batch import AzureBatchHook
  from airflow.providers.microsoft.azure.operators.batch import AzureBatchOperator
label_desc: Use image node_id 1 for calling the TestAzureBatchOperator obj's underlying member method code with example usage: obj.setup_test_cases(mocked_batch_service_client, create_mock_connections) without return types