code: def test_prepare_and_upload_workspace(
      session, mock_shutil_copy, mock_copy_workdir, mock_s3_upload
  ):
      s3_path = _prepare_and_upload_workspace(
          local_dependencies_path="some/path/to/dependency",
          include_local_workdir=True,
          pre_execution_commands=["cmd_1", "cmd_2"],
          pre_execution_script_local_path=None,
          s3_base_uri=S3_URI,
          s3_kms_key=KMS_KEY_ARN,
          sagemaker_session=session,
      )
  
      assert s3_path == mock_s3_upload.return_value
  
      mock_copy_workdir.assert_called_with(ANY, None)
      mock_shutil_copy.assert_called_with(
          "some/path/to/dependency", ANY
      )
      mock_s3_upload.assert_called_once_with(
          ANY,
          S3_URI + "/" + REMOTE_FUNCTION_WORKSPACE,
          KMS_KEY_ARN,
          session,
      )
  
imports: from __future__ import absolute_import
  import os
  import sys
  import pytest
  from mock import patch, Mock, ANY, mock_open
  from mock.mock import MagicMock
  from sagemaker.config import load_sagemaker_config
  from sagemaker.remote_function.checkpoint_location import CheckpointLocation
  from sagemaker.remote_function.core.stored_function import _SerializedData
  from sagemaker.session_settings import SessionSettings
  from sagemaker.remote_function.spark_config import SparkConfig
  from sagemaker.remote_function.custom_file_filter import CustomFileFilter
  from sagemaker.remote_function.core.pipeline_variables import Context
  from sagemaker.workflow.pipeline_context import _PipelineConfig
  from sagemaker.workflow.pipeline_definition_config import PipelineDefinitionConfig
  from sagemaker.workflow.execution_variables import ExecutionVariables
  from sagemaker.utils import sagemaker_timestamp
  from tests.unit import DATA_DIR
  from sagemaker.remote_function.job import _JobSettings, _Job, _convert_run_to_json, _prepare_and_upload_runtime_scripts, _prepare_and_upload_workspace, _prepare_and_upload_spark_dependent_files, _upload_spark_submit_deps, _upload_serialized_spark_configuration, _extend_spark_config_to_request, _prepare_dependencies_and_pre_execution_scripts
label_desc: Use image node_id 26 for calling a global function with example usage: test_prepare_and_upload_workspace(session, mock_shutil_copy, mock_copy_workdir, mock_s3_upload) without return types