File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -387,6 +387,27 @@ def test_crud_blob_w_user_project(self):
387387 # Exercise 'objects.delete' (metadata) w/ userProject.
388388 blob .delete ()
389389
390+ @unittest .skipUnless (USER_PROJECT , 'USER_PROJECT not set in environment.' )
391+ def test_blob_acl_w_user_project (self ):
392+ with_user_project = Config .CLIENT .bucket (
393+ self .bucket .name , user_project = USER_PROJECT )
394+ blob = with_user_project .blob ('SmallFile' )
395+
396+ file_data = self .FILES ['simple' ]
397+
398+ blob .upload_from_filename (file_data ['path' ])
399+ self .case_blobs_to_delete .append (blob )
400+
401+ # Exercise bucket ACL w/ userProject
402+ acl = blob .acl
403+ acl .reload ()
404+ acl .all ().grant_read ()
405+ acl .save ()
406+ self .assertIn ('READER' , acl .all ().get_roles ())
407+ del acl .entities ['allUsers' ]
408+ acl .save ()
409+ self .assertFalse (acl .has_entity ('allUsers' ))
410+
390411 def test_write_metadata (self ):
391412 filename = self .FILES ['logo' ]['path' ]
392413 blob_name = os .path .basename (filename )
You can’t perform that action at this time.
0 commit comments