code: def test_api_key_required(self, mock_get_connection, mock_initialize):
      mock_get_connection.return_value = Connection()
      with pytest.raises(AirflowException) as ctx:
          DatadogHook()
      assert (
          str(ctx.value)
          == "api_key must be specified in the Datadog connection details"
      )
  
file_path: airflow/tests/providers/datadog/hooks/test_datadog.py
imports: from __future__ import annotations
  import json
  from unittest import mock
  import pytest
  from airflow.exceptions import AirflowException
  from airflow.models import Connection
  from airflow.providers.datadog.hooks.datadog import DatadogHook
label_desc: Use image node_id 2 for calling the TestDatadogHook obj's underlying member method code with example usage: obj.test_api_key_required(mock_get_connection, mock_initialize) without return types