code: def test_allocate_ids(self, mock_get_conn):
      self.datastore_hook.connection = mock_get_conn.return_value
      partial_keys = []
  
      keys = self.datastore_hook.allocate_ids(
          partial_keys=partial_keys, project_id=GCP_PROJECT_ID
      )
  
      projects = self.datastore_hook.connection.projects
      projects.assert_called_once_with()
      allocate_ids = projects.return_value.allocateIds
      allocate_ids.assert_called_once_with(
          projectId=GCP_PROJECT_ID, body={"keys": partial_keys}
      )
      execute = allocate_ids.return_value.execute
      execute.assert_called_once_with(num_retries=mock.ANY)
      assert keys == execute.return_value["keys"]
  
imports: from __future__ import annotations
  from unittest import mock
  from unittest.mock import call, patch
  import pytest
  from airflow.exceptions import AirflowException
  from airflow.providers.google.cloud.hooks.datastore import DatastoreHook
label_desc: Use image node_id 4 for calling the TestDatastoreHook obj's underlying member method code with example usage: obj.test_allocate_ids(mock_get_conn) without return types