@@ -409,6 +409,7 @@ def test_blob_acl_w_user_project(
409
409
assert not acl .has_entity ("allUsers" )
410
410
411
411
412
+ # error
412
413
def test_blob_acl_w_metageneration_match (
413
414
shared_bucket ,
414
415
blobs_to_delete ,
@@ -425,28 +426,28 @@ def test_blob_acl_w_metageneration_match(
425
426
426
427
# Exercise blob ACL with metageneration/generation match
427
428
acl = blob .acl
428
- blob .reload ()
429
+ acl .domain ("google.com" ).grant_read ()
430
+ # blob.reload()
429
431
430
432
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 ()
435
435
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 )
438
437
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 ()
441
441
442
442
with pytest .raises (exceptions .PreconditionFailed ):
443
443
acl .save (if_generation_match = wrong_generation_number )
444
- assert acl .has_entity ( "allUsers" )
444
+ assert "READER" in acl .domain ( "google.com" ). get_roles ( )
445
445
446
446
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 ( )
448
448
449
449
450
+ # error
450
451
def test_blob_acl_upload_predefined (
451
452
shared_bucket ,
452
453
blobs_to_delete ,
0 commit comments