code: def test_retrieve_predictor_happy(self, mock_predictor, mock_session):
      shape = (3, 4)
      numpy_array = np.random.rand(*shape)
      schema_builder = SchemaBuilder(
          sample_input=numpy_array, sample_output=numpy_array
      )
      retrieve_predictor(
          endpoint_name=ENDPOINT_NAME,
          sagemaker_session=mock_session,
          schema_builder=schema_builder,
      )
      mock_predictor.assert_called_once_with(
          endpoint_name=ENDPOINT_NAME,
          sagemaker_session=ANY,
          serializer=schema_builder.input_serializer,
          deserializer=schema_builder.output_deserializer,
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/serve/utils/test_predictors.py
imports: from __future__ import absolute_import
  import io
  import unittest
  from unittest.mock import patch, ANY
  import numpy
  from sagemaker.serve.builder.schema_builder import SchemaBuilder
  from sagemaker.serve.marshalling.custom_payload_translator import CustomPayloadTranslator
  from sagemaker.serve.utils.predictors import retrieve_predictor
label_desc: Use image node_id 1 for calling the TestPredictors obj's underlying member method code with example usage: obj.test_retrieve_predictor_happy(mock_predictor, mock_session) without return types