Skip to content

Commit

Permalink
Add test for updating a subscription. [(#1336)](GoogleCloudPlatform/p…
Browse files Browse the repository at this point in the history
…ython-docs-samples#1336)

Tests for GoogleCloudPlatform/python-docs-samples#1335. Using ack_deadline_seconds as the example.
  • Loading branch information
noerog authored and engelke committed Dec 7, 2018
1 parent 0b31997 commit 824c9fa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions samples/snippets/subscriber_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ def _():
subscriber_client.get_subscription(subscription)


def test_update(subscriber_client, subscription, capsys):
ACK_DEADLINE_SECONDS = 100

subscriber.update_subscription(PROJECT, SUBSCRIPTION, ACK_DEADLINE_SECONDS)

out, _ = capsys.readouterr()
assert subscription in out
assert '100' in out


def _publish_messages(publisher_client, topic):
for n in range(5):
data = u'Message {}'.format(n).encode('utf-8')
Expand Down

0 comments on commit 824c9fa

Please sign in to comment.