File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,28 @@ def test_copy_existing_file_with_user_project(self):
243243 for blob in to_delete :
244244 retry_429 (blob .delete )()
245245
246+ @unittest .skipUnless (USER_PROJECT , 'USER_PROJECT not set in environment.' )
247+ def test_bucket_get_blob_with_user_project (self ):
248+ new_bucket_name = 'w-requester-pays' + unique_resource_id ('-' )
249+ data = b'DEADBEEF'
250+ created = Config .CLIENT .create_bucket (
251+ new_bucket_name , requester_pays = True )
252+ self .case_buckets_to_delete .append (new_bucket_name )
253+ self .assertEqual (created .name , new_bucket_name )
254+ self .assertTrue (created .requester_pays )
255+
256+ with_user_project = Config .CLIENT .bucket (
257+ new_bucket_name , user_project = USER_PROJECT )
258+
259+ self .assertIsNone (with_user_project .get_blob ('nonesuch' ))
260+ to_add = created .blob ('blob-name' )
261+ to_add .upload_from_string (data )
262+ try :
263+ found = with_user_project .get_blob ('blob-name' )
264+ self .assertEqual (found .download_as_string (), data )
265+ finally :
266+ to_add .delete ()
267+
246268
247269class TestStorageFiles (unittest .TestCase ):
248270
You can’t perform that action at this time.
0 commit comments