code: def test_get_workflow_invocation_raises_exception_on_cancel_workflow_invocation(
      self, mock_client, mock_state
  ):
      mock_client.return_value.get_dataform_client.return_value = None
      mock_state.side_effect = AirflowException(
          "Dataform API returned error when waiting for workflow invocation"
      )
  
      with pytest.raises(
          AirflowException, match="Dataform API returned error*."
      ):
          self.hook.cancel_workflow_invocation(
              project_id=PROJECT_ID,
              region=REGION,
              repository_id=REPOSITORY_ID,
              workflow_invocation_id=WORKFLOW_INVOCATION_ID,
          )
  
imports: from __future__ import annotations
  import logging
  from unittest import mock
  import pytest
  from google.api_core.gapic_v1.method import DEFAULT
  from google.cloud.dataform_v1beta1.types import WorkflowInvocation
  from airflow.exceptions import AirflowException
  from airflow.providers.google.cloud.hooks.dataform import DataformHook
  from tests.providers.google.cloud.utils.base_gcp_mock import mock_base_gcp_hook_default_project_id
label_desc: Use image node_id 9 for calling the TestDataformHook obj's underlying member method code with example usage: obj.test_get_workflow_invocation_raises_exception_on_cancel_workflow_invocation(mock_client, mock_state) without return types