Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions storage/tests/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,32 @@ def test_compose_replace_existing_blob(self):
composed = original.download_as_string()
self.assertEqual(composed, BEFORE + TO_APPEND)

@unittest.skipUnless(USER_PROJECT, 'USER_PROJECT not set in environment.')

This comment was marked as spam.

This comment was marked as spam.

def test_compose_with_user_project(self):
new_bucket_name = 'compose-user-project' + unique_resource_id('-')
created = Config.CLIENT.create_bucket(
new_bucket_name, requester_pays=True)
try:
SOURCE_1 = b'AAA\n'
source_1 = created.blob('source-1')

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

source_1.upload_from_string(SOURCE_1)

SOURCE_2 = b'BBB\n'
source_2 = created.blob('source-2')
source_2.upload_from_string(SOURCE_2)

with_user_project = Config.CLIENT.bucket(
new_bucket_name, user_project=USER_PROJECT)

destination = with_user_project.blob('destination')
destination.content_type = 'text/plain'
destination.compose([source_1, source_2])

composed = destination.download_as_string()
self.assertEqual(composed, SOURCE_1 + SOURCE_2)
finally:
retry_429(created.delete)(force=True)


class TestStorageRewrite(TestStorageFiles):

Expand Down