code: def test_list_deployments(self, mock_get_conn):
      response1 = {
          "deployments": [
              {"id": "deployment1", "name": "test-deploy1"}
          ],
          "pageToken": None,
      }
      response2 = {
          "deployments": [
              {"id": "deployment2", "name": "test-deploy2"}
          ],
          "pageToken": None,
      }
  
      mock_get_conn.return_value.deployments.return_value.list.return_value.execute.return_value = (
          response1
      )
  
      request_mock = mock.MagicMock()
      request_mock.execute.return_value = response2
      mock_get_conn.return_value.deployments.return_value.list_next.side_effect = [
          request_mock,
          None,
      ]
  
      deployments = self.gdm_hook.list_deployments(
          project_id=TEST_PROJECT,
          deployment_filter="filter",
          order_by="name",
      )
  
      mock_get_conn.assert_called_once_with()
  
      mock_get_conn.return_value.deployments.return_value.list.assert_called_once_with(
          project=TEST_PROJECT,
          filter="filter",
          orderBy="name",
      )
  
      assert (
          mock_get_conn.return_value.deployments.return_value.list_next.call_count
          == 2
      )
  
      assert deployments == [
          {"id": "deployment1", "name": "test-deploy1"},
          {"id": "deployment2", "name": "test-deploy2"},
      ]
  
file_path: airflow/tests/providers/google/cloud/hooks/test_gdm.py
imports: from __future__ import annotations
  from unittest import mock
  import pytest
  from airflow.exceptions import AirflowException
  from airflow.providers.google.cloud.hooks.gdm import GoogleDeploymentManagerHook
label_desc: Use image node_id 3 for calling the TestDeploymentManagerHook obj's underlying member method code with example usage: obj.test_list_deployments(mock_get_conn) without return types