  def testGetCluster(self, mock_gke_api):
    """Test GkeCluster calls the API correctly and returns its response."""
    clusters_api = mock_gke_api().projects().locations().clusters()
    clusters_api.get.return_value.execute.return_value = {
      'key': 'ddbjnaxz'
    }

    cluster = gke.GkeCluster('fake-project-id', 'fake-zone', 'fake-cluster-id')
    get_operation_result = cluster.GetOperation()

    clusters_api.get.assert_called_once_with(name=cluster.name)
    self.assertEqual({'key': 'ddbjnaxz'}, get_operation_result)

    # Test error case
    clusters_api.get.return_value.execute.side_effect = HttpError(
        resp=mock.Mock(status=404), content=b'Cluster not found')
    with self.assertRaises(errors.ResourceNotFoundError):
      cluster.GetOperation()
Test GkeCluster calls the API correctly and returns its response.
tests/providers/gcp/internal/test_gke.py