  def testAbandonInstance(self, mock_gce_api, mock_block_operation):
    """Test that instance is abandoned from Managed Instance Group."""
    mig = mock_gce_api.return_value.instanceGroupManagers.return_value.abandonInstances
    mig_request = mig.return_value.execute
    mig_request.return_value = gcp_mocks.MOCK_INSTANCE_ABANDONED
    mock_block_operation.return_value = gcp_mocks.MOCK_INSTANCE_ABANDONED
    # Check that call completes successfully
    gcp_mocks.FAKE_INSTANCE.AbandonFromMIG('fake-instance-group')
    self.assertTrue(mig_request.called)
Test that instance is abandoned from Managed Instance Group.
tests/providers/gcp/internal/test_compute.py