Skip to content

Commit 677d773

Browse files
authored
Fixing broken logging system test. (googleapis#3325)
Tries to update a frozenset().
1 parent 4a37b62 commit 677d773

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

logging/tests/system.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ def test_create_sink_storage_bucket(self):
389389
self.assertTrue(sink.exists())
390390

391391
def test_create_sink_pubsub_topic(self):
392+
from google.cloud.iam import OWNER_ROLE
392393
from google.cloud.pubsub import client as pubsub_client
394+
393395
SINK_NAME = 'test-create-sink-topic%s' % (_RESOURCE_ID,)
394396
TOPIC_NAME = 'logging-test-sink%s' % (_RESOURCE_ID,)
395397

@@ -400,7 +402,9 @@ def test_create_sink_pubsub_topic(self):
400402
topic.create()
401403
self.to_delete.append(topic)
402404
policy = topic.get_iam_policy()
403-
policy.owners.add(policy.group('cloud-logs@google.com'))
405+
new_owners = set([policy.group('cloud-logs@google.com')])
406+
new_owners.update(policy.owners)
407+
policy[OWNER_ROLE] = new_owners
404408
topic.set_iam_policy(policy)
405409

406410
TOPIC_URI = 'pubsub.googleapis.com/%s' % (topic.full_name,)

0 commit comments

Comments
 (0)