Skip to content

Commit

Permalink
Add system test exercising 'Subscription.create' w/ 'ack_deadline' set.
Browse files Browse the repository at this point in the history
Addresses:
#1182 (comment)
  • Loading branch information
tseaver committed Oct 14, 2015
1 parent 0001b37 commit 543caaf
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion system_tests/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_list_topics(self):
topic.project == CLIENT.project]
self.assertEqual(len(created), len(topics_to_create))

def test_create_subscription(self):
def test_create_subscription_defaults(self):
TOPIC_NAME = 'subscribe-me'
topic = CLIENT.topic(TOPIC_NAME)
self.assertFalse(topic.exists())
Expand All @@ -76,6 +76,22 @@ def test_create_subscription(self):
self.assertEqual(subscription.name, SUBSCRIPTION_NAME)
self.assertTrue(subscription.topic is topic)

def test_create_subscription_w_ack_deadline(self):
TOPIC_NAME = 'subscribe-me'
topic = CLIENT.topic(TOPIC_NAME)
self.assertFalse(topic.exists())
topic.create()
self.to_delete.append(topic)
SUBSCRIPTION_NAME = 'subscribing-now'
subscription = topic.subscription(SUBSCRIPTION_NAME, ack_deadline=120)
self.assertFalse(subscription.exists())
subscription.create()
self.to_delete.append(subscription)
self.assertTrue(subscription.exists())
self.assertEqual(subscription.name, SUBSCRIPTION_NAME)
self.assertEqual(subscription.ack_deadline, 120)
self.assertTrue(subscription.topic is topic)

def test_list_subscriptions(self):
TOPIC_NAME = 'subscribe-me'
topic = CLIENT.topic(TOPIC_NAME)
Expand Down

0 comments on commit 543caaf

Please sign in to comment.