code: def test_sensor_with_failure(self, mock_describe, _):
      response_failure = self.get_response_with_state("Failed")
      mock_describe.return_value = response_failure
      sensor = SageMakerPipelineSensor(
          pipeline_exec_arn="ARN", task_id="test_task"
      )
  
      with pytest.raises(AirflowException):
          sensor.execute(None)
  
      mock_describe.assert_called_once_with("ARN", True)
  
file_path: airflow/tests/providers/amazon/aws/sensors/test_sagemaker_pipeline.py
imports: from __future__ import annotations
  import copy
  from datetime import datetime
  from unittest import mock
  import pytest
  from airflow.exceptions import AirflowException
  from airflow.providers.amazon.aws.hooks.sagemaker import SageMakerHook
  from airflow.providers.amazon.aws.sensors.sagemaker import SageMakerPipelineSensor
label_desc: Use image node_id 2 for calling the TestSageMakerPipelineSensor obj's underlying member method code with example usage: obj.test_sensor_with_failure(mock_describe, _) without return types