code: def test_build_happy_path_with_local_container_mode(
      self,
      mock_path_exists,
      mock_sdk_model,
      mock_localContainerMode,
      mock_serveSettings,
      mock_detect_container,
      mock_save_pkl,
      mock_prepare_for_torchserve,
  ):
      # setup mocks
      mock_native_model = Mock()
      mock_inference_spec.load = (
          lambda model_path: mock_native_model
          if model_path == MODEL_PATH
          else None
      )
  
      mock_detect_container.side_effect = (
          lambda model, region, instance_type: mock_image_uri
          if model == mock_native_model
          and region == mock_session.boto_region_name
          and instance_type == "ml.c5.xlarge"
          else None
      )
  
      mock_prepare_for_torchserve.side_effect = (
          lambda model_path, shared_libs, dependencies, session, image_uri, inference_spec: mock_secret_key
          if model_path == MODEL_PATH
          and shared_libs == []
          and dependencies == {"auto": False}
          and session == mock_session
          and image_uri == mock_image_uri
          and inference_spec == mock_inference_spec
          else None
      )
  
      # Mock _ServeSettings
      mock_setting_object = mock_serveSettings.return_value
      mock_setting_object.role_arn = mock_role_arn
      mock_setting_object.s3_model_data_url = mock_s3_model_data_url
  
      mock_path_exists.side_effect = (
          lambda path: True if path == "test_path" else False
      )
  
      mock_mode = Mock()
      mock_localContainerMode.side_effect = (
          lambda inference_spec, schema_builder, session, model_path, env_vars, model_server: mock_mode
          if inference_spec == mock_inference_spec
          and schema_builder == schema_builder
          and model_server == ModelServer.TORCHSERVE
          and session == mock_session
          and model_path == MODEL_PATH
          and env_vars == {}
          and model_server == ModelServer.TORCHSERVE
          else None
      )
      mock_mode.prepare.side_effect = lambda: None
  
      mock_model_obj = Mock()
      mock_sdk_model.side_effect = (
          lambda image_uri, model_data, role, env, sagemaker_session, predictor_cls: mock_model_obj
          if image_uri == mock_image_uri
          and model_data is None
          and role == mock_role_arn
          and env == {}
          and sagemaker_session == mock_session
          else None
      )
  
      # run
      builder = ModelBuilder(
          model_path=MODEL_PATH,
          schema_builder=schema_builder,
          inference_spec=mock_inference_spec,
          mode=Mode.LOCAL_CONTAINER,
      )
      build_result = builder.build(sagemaker_session=mock_session)
  
      # assert pkl file was saved
      mock_save_pkl.assert_called_once_with(
          CODE_PATH, (mock_inference_spec, schema_builder)
      )
  
      # assert model returned by builder is expected
      self.assertEqual(mock_model_obj, build_result)
      self.assertEqual(build_result.mode, Mode.LOCAL_CONTAINER)
      self.assertEqual(build_result.serve_settings, mock_setting_object)
  
imports: from __future__ import absolute_import
  from unittest.mock import MagicMock, patch, Mock
  import unittest
  from pathlib import Path
  from sagemaker.serve.builder.model_builder import ModelBuilder
  from sagemaker.serve.mode.function_pointers import Mode
  from sagemaker.serve.utils.types import ModelServer
label_desc: Use image node_id 11 for calling the TestModelBuilder obj's underlying member method code with example usage: obj.test_build_happy_path_with_local_container_mode(mock_path_exists, mock_sdk_model, mock_localContainerMode, mock_serveSettings, mock_detect_container, mock_save_pkl, mock_prepare_for_torchserve) without return types