code: def test_lambda_step_without_function_arn_and_with_error(
      sagemaker_session_cn,
  ):
      lambda_func = MagicMock(
          function_arn=None,
          function_name="name",
          execution_role_arn="arn:aws:lambda:us-west-2:123456789012:execution_role",
          zipped_code_dir="",
          handler="",
          session=sagemaker_session_cn,
      )
  
      lambda_func.upsert.side_effect = ValueError()
      lambda_step = LambdaStep(
          name="MyLambdaStep",
          depends_on=["TestStep"],
          lambda_func=lambda_func,
          inputs={},
          outputs=[],
      )
      with pytest.raises(ValueError):
          lambda_step._get_function_arn()
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/workflow/test_lambda_step.py
imports: from __future__ import absolute_import
  import json
  import pytest
  from mock import Mock, MagicMock
  from sagemaker.workflow.parameters import ParameterInteger, ParameterString
  from sagemaker.workflow.pipeline import Pipeline, PipelineGraph
  from sagemaker.workflow.lambda_step import LambdaStep, LambdaOutput, LambdaOutputTypeEnum
  from sagemaker.lambda_helper import Lambda
  from sagemaker.workflow.steps import CacheConfig
  from tests.unit.sagemaker.workflow.helpers import CustomStep, ordered
label_desc: Use image node_id 9 for calling a global function with example usage: test_lambda_step_without_function_arn_and_with_error(sagemaker_session_cn) without return types