Skip to content

Commit 824c9fa

Browse files
noerogengelke
authored andcommitted
Add test for updating a subscription. [(googleapis#1336)](GoogleCloudPlatform/python-docs-samples#1336)
Tests for GoogleCloudPlatform/python-docs-samples#1335. Using ack_deadline_seconds as the example.
1 parent 0b31997 commit 824c9fa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

samples/snippets/subscriber_test.py

+10
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,16 @@ def _():
154154
subscriber_client.get_subscription(subscription)
155155

156156

157+
def test_update(subscriber_client, subscription, capsys):
158+
ACK_DEADLINE_SECONDS = 100
159+
160+
subscriber.update_subscription(PROJECT, SUBSCRIPTION, ACK_DEADLINE_SECONDS)
161+
162+
out, _ = capsys.readouterr()
163+
assert subscription in out
164+
assert '100' in out
165+
166+
157167
def _publish_messages(publisher_client, topic):
158168
for n in range(5):
159169
data = u'Message {}'.format(n).encode('utf-8')

0 commit comments

Comments
 (0)