File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -650,6 +650,32 @@ def test_compose_replace_existing_blob(self):
650650 composed = original .download_as_string ()
651651 self .assertEqual (composed , BEFORE + TO_APPEND )
652652
653+ @unittest .skipUnless (USER_PROJECT , 'USER_PROJECT not set in environment.' )
654+ def test_compose_with_user_project (self ):
655+ new_bucket_name = 'compose-user-project' + unique_resource_id ('-' )
656+ created = Config .CLIENT .create_bucket (
657+ new_bucket_name , requester_pays = True )
658+ try :
659+ SOURCE_1 = b'AAA\n '
660+ source_1 = created .blob ('source-1' )
661+ source_1 .upload_from_string (SOURCE_1 )
662+
663+ SOURCE_2 = b'BBB\n '
664+ source_2 = created .blob ('source-2' )
665+ source_2 .upload_from_string (SOURCE_2 )
666+
667+ with_user_project = Config .CLIENT .bucket (
668+ new_bucket_name , user_project = USER_PROJECT )
669+
670+ destination = with_user_project .blob ('destination' )
671+ destination .content_type = 'text/plain'
672+ destination .compose ([source_1 , source_2 ])
673+
674+ composed = destination .download_as_string ()
675+ self .assertEqual (composed , SOURCE_1 + SOURCE_2 )
676+ finally :
677+ retry_429 (created .delete )(force = True )
678+
653679
654680class TestStorageRewrite (TestStorageFiles ):
655681
You can’t perform that action at this time.
0 commit comments