  def testCreateInstanceFromArguments(self,
      mock_create_from_request, mock_get_machine_type,
      mock_get_disk_type, mock_get_image_family, mock_get_network):
    """Test creating compute instance via providing arguments."""
    mock_create_from_request.return_value = gcp_mocks.FAKE_INSTANCE
    mock_get_machine_type.return_value = gcp_mocks.MOCK_MACHINE_TYPES
    mock_get_disk_type.return_value = gcp_mocks.MOCK_DISK_TYPES
    mock_get_image_family.return_value = gcp_mocks.MOCK_COMPUTE_IMAGE
    mock_get_network.return_value = gcp_mocks.MOCK_COMPUTE_NETWORK

    instance = gcp_mocks.FAKE_ANALYSIS_PROJECT.compute.CreateInstanceFromArguments(
        gcp_mocks.FAKE_INSTANCE.name, 'e2-medium', 'us-central1-a', boot_disk_size=10,
        boot_image_project='debian-cloud', boot_image_family='debian-10',
        metadata={'startup-script': gcp_mocks.STARTUP_SCRIPT})
    mock_create_from_request.assert_called()
    self.assertIsInstance(instance, compute.GoogleComputeInstance)
    self.assertEqual('fake-instance', instance.name)
Test creating compute instance via providing arguments.
tests/providers/gcp/internal/test_compute.py