Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipping IAM system tests when running in emulator. #1748

Merged
merged 1 commit into from
Apr 27, 2016
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