@@ -453,7 +453,7 @@ def test_list_subscriptions_missing_key(self):
453453 self .assertEqual (req ['query_params' ], {})
454454
455455 def test_get_iam_policy_w_bound_client (self ):
456- from gcloud .pubsub .iam import OWNER_ROLE , WRITER_ROLE , READER_ROLE
456+ from gcloud .pubsub .iam import OWNER_ROLE , EDITOR_ROLE , VIEWER_ROLE
457457 OWNER1 = 'user:phred@example.com'
458458 OWNER2 = 'group:cloud-logs@google.com'
459459 WRITER1 = 'domain:google.com'
@@ -465,8 +465,8 @@ def test_get_iam_policy_w_bound_client(self):
465465 'version' : 17 ,
466466 'bindings' : [
467467 {'role' : OWNER_ROLE , 'members' : [OWNER1 , OWNER2 ]},
468- {'role' : WRITER_ROLE , 'members' : [WRITER1 , WRITER2 ]},
469- {'role' : READER_ROLE , 'members' : [READER1 , READER2 ]},
468+ {'role' : EDITOR_ROLE , 'members' : [WRITER1 , WRITER2 ]},
469+ {'role' : VIEWER_ROLE , 'members' : [READER1 , READER2 ]},
470470 ],
471471 }
472472 TOPIC_NAME = 'topic_name'
@@ -522,7 +522,7 @@ def test_get_iam_policy_w_alternate_client(self):
522522
523523 def test_set_iam_policy_w_bound_client (self ):
524524 from gcloud .pubsub .iam import Policy
525- from gcloud .pubsub .iam import OWNER_ROLE , WRITER_ROLE , READER_ROLE
525+ from gcloud .pubsub .iam import OWNER_ROLE , EDITOR_ROLE , VIEWER_ROLE
526526 OWNER1 = 'group:cloud-logs@google.com'
527527 OWNER2 = 'user:phred@example.com'
528528 WRITER1 = 'domain:google.com'
@@ -534,8 +534,8 @@ def test_set_iam_policy_w_bound_client(self):
534534 'version' : 17 ,
535535 'bindings' : [
536536 {'role' : OWNER_ROLE , 'members' : [OWNER1 , OWNER2 ]},
537- {'role' : WRITER_ROLE , 'members' : [WRITER1 , WRITER2 ]},
538- {'role' : READER_ROLE , 'members' : [READER1 , READER2 ]},
537+ {'role' : EDITOR_ROLE , 'members' : [WRITER1 , WRITER2 ]},
538+ {'role' : VIEWER_ROLE , 'members' : [READER1 , READER2 ]},
539539 ],
540540 }
541541 RESPONSE = POLICY .copy ()
@@ -569,7 +569,7 @@ def test_set_iam_policy_w_bound_client(self):
569569 req = conn ._requested [0 ]
570570 self .assertEqual (req ['method' ], 'POST' )
571571 self .assertEqual (req ['path' ], '/%s' % PATH )
572- self .assertEqual (req ['data' ], POLICY )
572+ self .assertEqual (req ['data' ], { 'policy' : POLICY } )
573573
574574 def test_set_iam_policy_w_alternate_client (self ):
575575 from gcloud .pubsub .iam import Policy
@@ -599,15 +599,15 @@ def test_set_iam_policy_w_alternate_client(self):
599599 req = conn2 ._requested [0 ]
600600 self .assertEqual (req ['method' ], 'POST' )
601601 self .assertEqual (req ['path' ], '/%s' % PATH )
602- self .assertEqual (req ['data' ], {})
602+ self .assertEqual (req ['data' ], {'policy' : {} })
603603
604604 def test_check_iam_permissions_w_bound_client (self ):
605- from gcloud .pubsub .iam import OWNER_ROLE , WRITER_ROLE , READER_ROLE
605+ from gcloud .pubsub .iam import OWNER_ROLE , EDITOR_ROLE , VIEWER_ROLE
606606 TOPIC_NAME = 'topic_name'
607607 PROJECT = 'PROJECT'
608608 PATH = 'projects/%s/topics/%s:testIamPermissions' % (
609609 PROJECT , TOPIC_NAME )
610- ROLES = [READER_ROLE , WRITER_ROLE , OWNER_ROLE ]
610+ ROLES = [VIEWER_ROLE , EDITOR_ROLE , OWNER_ROLE ]
611611 REQUESTED = {
612612 'permissions' : ROLES ,
613613 }
@@ -628,12 +628,12 @@ def test_check_iam_permissions_w_bound_client(self):
628628 self .assertEqual (req ['data' ], REQUESTED )
629629
630630 def test_check_iam_permissions_w_alternate_client (self ):
631- from gcloud .pubsub .iam import OWNER_ROLE , WRITER_ROLE , READER_ROLE
631+ from gcloud .pubsub .iam import OWNER_ROLE , EDITOR_ROLE , VIEWER_ROLE
632632 TOPIC_NAME = 'topic_name'
633633 PROJECT = 'PROJECT'
634634 PATH = 'projects/%s/topics/%s:testIamPermissions' % (
635635 PROJECT , TOPIC_NAME )
636- ROLES = [READER_ROLE , WRITER_ROLE , OWNER_ROLE ]
636+ ROLES = [VIEWER_ROLE , EDITOR_ROLE , OWNER_ROLE ]
637637 REQUESTED = {
638638 'permissions' : ROLES ,
639639 }
0 commit comments