  def testGetOrCreateAnalysisVmExist(self, mock_create_from_args, mock_get_instance):
    """Test getting analysis VM, if instance already exists"""
    mock_get_instance.return_value = gcp_mocks.FAKE_ANALYSIS_VM

    vm, created = gcp_mocks.FAKE_ANALYSIS_PROJECT.compute.GetOrCreateAnalysisVm(
        gcp_mocks.FAKE_ANALYSIS_VM.name, boot_disk_size=1)

    mock_get_instance.assert_called_with(gcp_mocks.FAKE_ANALYSIS_VM.name)
    self.assertIsInstance(vm, compute.GoogleComputeInstance)
    self.assertEqual('fake-analysis-vm', vm.name)
    self.assertFalse(created)
    mock_create_from_args.assert_not_called()
Test getting analysis VM, if instance already exists
tests/providers/gcp/internal/test_compute.py