code: def test_config_aws_credentials(py_spark_processor):
      expected_result = {
          "AWS_ACCESS_KEY_ID": "123",
          "AWS_SECRET_ACCESS_KEY": "456",
          "AWS_SESSION_TOKEN": "789",
      }
  
      creds = MagicMock(access_key="123", secret_key="456", token="789")
      py_spark_processor.sagemaker_session.boto_session.get_credentials = MagicMock(
          name="get_credentials", return_value=creds
      )
      assert (
          py_spark_processor._config_aws_credentials()
          == expected_result
      )
  
      py_spark_processor.sagemaker_session.boto_session.get_credentials = MagicMock(
          name="get_credentials", side_effect=ValueError
      )
      assert not py_spark_processor._config_aws_credentials()
  
imports: from __future__ import absolute_import
  import pathlib
  import subprocess
  import tempfile
  from io import BytesIO
  from typing import Generator
  from unittest.case import TestCase
  from unittest.mock import MagicMock, Mock, call, mock_open, patch
  import pytest
  from sagemaker.processing import ProcessingInput, ProcessingOutput
  from sagemaker.session_settings import SessionSettings
  from sagemaker.spark.processing import PySparkProcessor, SparkJarProcessor, _SparkProcessorBase, _HistoryServer, FileType, SparkConfigUtils
label_desc: Use image node_id 27 for calling a global function with example usage: test_config_aws_credentials(py_spark_processor) without return types