code: def test_repack_model_step(estimator):
      model_data = f"s3://{BUCKET}/model.tar.gz"
      entry_point = f"{DATA_DIR}/dummy_script.py"
      step = _RepackModelStep(
          name="MyRepackModelStep",
          sagemaker_session=estimator.sagemaker_session,
          role=estimator.role,
          model_data=model_data,
          entry_point=entry_point,
          depends_on=["TestStep"],
      )
      request_dict = step.to_request()
      # No source_dir supplied to _RepackModelStep
      # so a temp dir will be created and
      # the repack script and launcher files will be moved/created there
      assert os.path.isfile(f"{step._source_dir}/{REPACK_SCRIPT}")
      assert os.path.isfile(
          f"{step._source_dir}/{REPACK_SCRIPT_LAUNCHER}"
      )
  
      hyperparameters = request_dict["Arguments"]["HyperParameters"]
      assert hyperparameters["inference_script"] == '"dummy_script.py"'
      assert (
          hyperparameters["model_archive"]
          == '"s3://my-bucket/model.tar.gz"'
      )
      assert (
          hyperparameters["sagemaker_program"]
          == f'"{REPACK_SCRIPT_LAUNCHER}"'
      )
      assert (
          hyperparameters["sagemaker_submit_directory"]
          == '"s3://my-bucket/MyRepackModelStep-b5ea77f701b47a8d075605497462ccc2/source/sourcedir.tar.gz"'
      )
  
      del request_dict["Arguments"]["HyperParameters"]
      del request_dict["Arguments"]["AlgorithmSpecification"][
          "TrainingImage"
      ]
      assert request_dict == {
          "Name": "MyRepackModelStep",
          "Type": "Training",
          "DependsOn": ["TestStep"],
          "Arguments": {
              "AlgorithmSpecification": {"TrainingInputMode": "File"},
              "DebugHookConfig": {
                  "CollectionConfigurations": [],
                  "S3OutputPath": "s3://my-bucket/",
              },
              "InputDataConfig": [
                  {
                      "ChannelName": "training",
                      "DataSource": {
                          "S3DataSource": {
                              "S3DataDistributionType": "FullyReplicated",
                              "S3DataType": "S3Prefix",
                              "S3Uri": f"s3://{BUCKET}/model.tar.gz",
                          }
                      },
                  }
              ],
              "OutputDataConfig": {"S3OutputPath": f"s3://{BUCKET}/"},
              "ProfilerConfig": {"DisableProfiler": True},
              "ResourceConfig": {
                  "InstanceCount": 1,
                  "InstanceType": "ml.m5.large",
                  "VolumeSizeInGB": 30,
              },
              "RoleArn": ROLE,
              "StoppingCondition": {"MaxRuntimeInSeconds": 86400},
          },
      }
      assert step.properties.TrainingJobName.expr == {
          "Get": "Steps.MyRepackModelStep.TrainingJobName"
      }
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/workflow/test_utils.py
imports: from __future__ import absolute_import
  import os
  import shutil
  import tempfile
  import pytest
  from sagemaker.estimator import Estimator
  from sagemaker.workflow._utils import _RepackModelStep, _RegisterModelStep, REPACK_SCRIPT, REPACK_SCRIPT_LAUNCHER
  from sagemaker.workflow.properties import Properties
  from tests.unit.test_utils import FakeS3, list_tar_files
  from tests.unit import DATA_DIR
  from tests.unit.sagemaker.workflow.conftest import ROLE, IMAGE_URI, BUCKET
label_desc: Use image node_id 3 for calling a global function with example usage: test_repack_model_step(estimator) without return types