code: def test_emr_step_throws_exception_when_cluster_config_contains_restricted_entities(
      invalid_cluster_config, expected_error_msg
  ):
      with pytest.raises(ValueError) as exceptionInfo:
          EMRStep(
              name=g_emr_step_name,
              display_name="MyEMRStep",
              description="MyEMRStepDescription",
              cluster_id=None,
              step_config=g_emr_step_config,
              cluster_config=invalid_cluster_config,
              depends_on=["TestStep"],
              cache_config=CacheConfig(
                  enable_caching=True, expire_after="PT1H"
              ),
          )
  
      actual_error_msg = exceptionInfo.value.args[0]
  
      assert actual_error_msg == expected_error_msg
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/workflow/test_emr_step.py
imports: from __future__ import absolute_import
  import json
  import pytest
  from sagemaker.workflow.emr_step import EMRStep, EMRStepConfig, ERR_STR_WITH_NAME_AUTO_TERMINATION_OR_STEPS, ERR_STR_WITHOUT_INSTANCE, ERR_STR_WITH_KEEPJOBFLOW_OR_TERMINATIONPROTECTED, ERR_STR_BOTH_OR_NONE_INSTANCEGROUPS_OR_INSTANCEFLEETS, ERR_STR_WITH_BOTH_CLUSTER_ID_AND_CLUSTER_CFG, ERR_STR_WITHOUT_CLUSTER_ID_AND_CLUSTER_CFG, ERR_STR_WITH_EXEC_ROLE_ARN_AND_WITHOUT_CLUSTER_ID
  from sagemaker.workflow.steps import CacheConfig
  from sagemaker.workflow.pipeline import Pipeline, PipelineGraph
  from sagemaker.workflow.parameters import ParameterString
  from tests.unit.sagemaker.workflow.helpers import CustomStep, ordered
label_desc: Use image node_id 7 for calling a global function with example usage: test_emr_step_throws_exception_when_cluster_config_contains_restricted_entities(invalid_cluster_config, expected_error_msg) without return types