Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Add system test exercising 'Subscription.create' w/ 'ack_deadline' set.
Addresses:
#1182 (comment)
  • Loading branch information
tseaver committed Oct 14, 2015
commit 543caafeca36e44d59402c4d738277de35e510fe
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