Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a420f48

Browse filesBrowse files
noerogJon Wayne Parrott
authored andcommitted
Add tests for creating push subscription. (GoogleCloudPlatform#1332)
This is a separate PR from actually adding the sample, which is in GoogleCloudPlatform#1331.
1 parent cb26c15 commit a420f48
Copy full SHA for a420f48

File tree

Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed

‎pubsub/cloud-client/subscriber_test.py

Copy file name to clipboardExpand all lines: pubsub/cloud-client/subscriber_test.py
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
PROJECT = os.environ['GCLOUD_PROJECT']
2626
TOPIC = 'subscription-test-topic'
2727
SUBSCRIPTION = 'subscription-test-subscription'
28+
ENDPOINT = 'https://{}.appspot.com/push'.format(PROJECT)
2829

2930

3031
@pytest.fixture(scope='module')
@@ -97,6 +98,21 @@ def _():
9798
assert subscriber_client.get_subscription(subscription_path)
9899

99100

101+
def test_create_push(subscriber_client):
102+
subscription_path = subscriber_client.subscription_path(
103+
PROJECT, SUBSCRIPTION)
104+
try:
105+
subscriber_client.delete_subscription(subscription_path)
106+
except Exception:
107+
pass
108+
109+
subscriber.create_push_subscription(PROJECT, TOPIC, SUBSCRIPTION, ENDPOINT)
110+
111+
@eventually_consistent.call
112+
def _():
113+
assert subscriber_client.get_subscription(subscription_path)
114+
115+
100116
def test_delete(subscriber_client, subscription):
101117
subscriber.delete_subscription(PROJECT, SUBSCRIPTION)
102118

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.