  def testGetOrCreateAnalysisVmNew(self, mock_create_from_args, mock_get_instance):
    """Test creating analysis VM, no existing instance"""
    mock_get_instance.side_effect = errors.ResourceNotFoundError('', __name__)
    mock_create_from_args.return_value = gcp_mocks.FAKE_ANALYSIS_VM

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

    self.assertIsInstance(vm, compute.GoogleComputeInstance)
    self.assertEqual(gcp_mocks.FAKE_ANALYSIS_VM.name, vm.name)
    self.assertTrue(created)
Test creating analysis VM, no existing instance
tests/providers/gcp/internal/test_compute.py