code: def test_generate_events(
      self,
      mock_get_job_run_artifact,
      mock_get_project,
      mock_get_job_run,
      mock_build_task_instance_run_id,
      mock_get_openlineage_listener,
  ):
      mock_operator = MagicMock(spec=DbtCloudRunJobOperator)
      mock_operator.account_id = None
  
      mock_hook = DbtCloudHook()
      mock_operator.hook = mock_hook
  
      mock_get_job_run.return_value.json.return_value = read_file_json(
          "tests/providers/dbt/cloud/test_data/job_run.json"
      )
      mock_get_project.return_value.json.return_value = {
          "data": {
              "connection": {
                  "type": "snowflake",
                  "details": {
                      "account": "gp21411.us-east-1",
                      "database": "SANDBOX",
                      "warehouse": "HUMANS",
                      "allow_sso": False,
                      "client_session_keep_alive": False,
                      "role": None,
                  },
              }
          }
      }
      mock_get_job_run_artifact.side_effect = get_dbt_artifact
      mock_operator.task_id = TASK_ID
      mock_operator.run_id = 188471607
  
      mock_task_instance = MagicMock()
      mock_task_instance.task_id = TASK_ID
      mock_task_instance.dag_id = DAG_ID
  
      mock_client = MagicMock()
  
      mock_client.emit.side_effect = emit_event
      mock_get_openlineage_listener.return_value.adapter.get_or_create_openlineage_client.return_value = (
          mock_client
      )
  
      mock_build_task_instance_run_id.return_value = TASK_UUID
      generate_openlineage_events_from_dbt_cloud_run(
          mock_operator, task_instance=mock_task_instance
      )
      assert mock_client.emit.call_count == 4
  
file_path: airflow/tests/providers/dbt/cloud/utils/test_openlineage.py
imports: from __future__ import annotations
  import json
  from unittest.mock import MagicMock, patch
  from airflow.providers.dbt.cloud.hooks.dbt import DbtCloudHook
  from airflow.providers.dbt.cloud.operators.dbt import DbtCloudRunJobOperator
  from airflow.providers.dbt.cloud.utils.openlineage import generate_openlineage_events_from_dbt_cloud_run
  from airflow.providers.openlineage.extractors import OperatorLineage
label_desc: Use image node_id 1 for calling the TestGenerateOpenLineageEventsFromDbtCloudRun obj's underlying member method code with example usage: obj.test_generate_events(mock_get_job_run_artifact, mock_get_project, mock_get_job_run, mock_build_task_instance_run_id, mock_get_openlineage_listener) without return types