Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions system_tests/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,16 @@ def _by_timestamp(message):
self.assertEqual(message2.data, MESSAGE_2)
self.assertEqual(message2.attributes['extra'], EXTRA_2)

def _maybe_emulator_skip(self):
# NOTE: We check at run-time rather than using the @unittest2.skipIf
# decorator. This matches the philosophy behind using
# setUpModule to determine the environment at run-time
# rather than at import time.
if os.getenv(PUBSUB_EMULATOR) is not None:
self.skipTest('IAM not supported by Pub/Sub emulator')

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

def test_topic_iam_policy(self):
self._maybe_emulator_skip()
topic_name = 'test-topic-iam-policy-topic' + unique_resource_id('-')
topic = Config.CLIENT.topic(topic_name)
topic.create()
Expand All @@ -187,6 +196,7 @@ def test_topic_iam_policy(self):
self.assertEqual(new_policy.viewers, policy.viewers)

def test_subscription_iam_policy(self):
self._maybe_emulator_skip()
topic_name = 'test-sub-iam-policy-topic' + unique_resource_id('-')
topic = Config.CLIENT.topic(topic_name)
topic.create()
Expand Down