  def testCreateImageFromGcsTarGz(self, mock_gce_api, mock_gce_image, mock_block_operation):
    """Test that images are correctly imported from compressed tar archives in GCS."""
    mock_block_operation.return_value = None
    mock_gce_image.return_value = gcp_mocks.FAKE_IMAGE
    image_insert = mock_gce_api.return_value.images.return_value.insert
    image_insert.return_value.execute.return_value = {'name': 'fake-image'}
    image_object = gcp_mocks.FAKE_ANALYSIS_PROJECT.compute.CreateImageFromGcsTarGz(
        'gs://fake-bucket/fake-folder/image.tar.gz', 'fake-image')
    self.assertIn('fake-image', image_object.name)
    fake_image_body = {
        'name': 'fake-image',
        'rawDisk': {
            'source': 'https://storage.cloud.google.com/fake-bucket/fake-folder/image.tar.gz'
        }
    }
    image_insert.assert_called_with(project=gcp_mocks.FAKE_ANALYSIS_PROJECT.project_id,
                                    body=fake_image_body,
                                    forceCreate=True)
Test that images are correctly imported from compressed tar archives in GCS.
tests/providers/gcp/internal/test_compute.py