Skip to content

Commit 690db41

Browse files
committed
fix: test_blob_acl_w_metageneration_match
1 parent e84906c commit 690db41

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

tests/system/test_blob.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ def test_blob_acl_w_user_project(
409409
assert not acl.has_entity("allUsers")
410410

411411

412+
# error
412413
def test_blob_acl_w_metageneration_match(
413414
shared_bucket,
414415
blobs_to_delete,
@@ -425,28 +426,28 @@ def test_blob_acl_w_metageneration_match(
425426

426427
# Exercise blob ACL with metageneration/generation match
427428
acl = blob.acl
428-
blob.reload()
429+
acl.domain("google.com").grant_read()
430+
# blob.reload()
429431

430432
with pytest.raises(exceptions.PreconditionFailed):
431-
acl.save_predefined(
432-
"publicRead", if_metageneration_match=wrong_metageneration_number
433-
)
434-
assert "READER" not in acl.all().get_roles()
433+
acl.save(if_metageneration_match=wrong_metageneration_number)
434+
assert "READER" not in acl.domain("google.com").get_roles()
435435

436-
acl.save_predefined("publicRead", if_metageneration_match=blob.metageneration)
437-
assert "READER" in acl.all().get_roles()
436+
acl.save(if_metageneration_match=blob.metageneration)
438437

439-
blob.reload()
440-
del acl.entities["allUsers"]
438+
assert "READER" in acl.domain("google.com").get_roles()
439+
# blob.reload()
440+
acl.domain("google.com").revoke_read()
441441

442442
with pytest.raises(exceptions.PreconditionFailed):
443443
acl.save(if_generation_match=wrong_generation_number)
444-
assert acl.has_entity("allUsers")
444+
assert "READER" in acl.domain("google.com").get_roles()
445445

446446
acl.save(if_generation_match=blob.generation)
447-
assert not acl.has_entity("allUsers")
447+
assert "READER" not in acl.domain("google.com").get_roles()
448448

449449

450+
# error
450451
def test_blob_acl_upload_predefined(
451452
shared_bucket,
452453
blobs_to_delete,

0 commit comments

Comments
 (0)