| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -387,6 +387,27 @@ def test_crud_blob_w_user_project(self): | |||
| 387 | 387 | # Exercise 'objects.delete' (metadata) w/ userProject. | |
| 388 | 388 | blob.delete() | |
| 389 | 389 | ||
| 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 | + | ||
| 390 | 411 | def test_write_metadata(self): | |
| 391 | 412 | filename = self.FILES['logo']['path'] | |
| 392 | 413 | blob_name = os.path.basename(filename) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments