Skip to content

Commit

Permalink
chore(deps): update dependency google-cloud-pubsub to v2 (#46)
Browse files Browse the repository at this point in the history
Updated sample to use pubsub v2
  • Loading branch information
renovate-bot authored Oct 19, 2020
1 parent cf3c957 commit 4cf7bcf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
google-cloud-pubsub==1.7.0
google-cloud-pubsub==2.1.0
google-cloud-containeranalysis==2.0.0
grafeas==1.0.1
pytest==5.3.0; python_version > "3.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@ def create_occurrence_subscription(subscription_id, project_id):

topic_id = 'container-analysis-occurrences-v1'
client = SubscriberClient()
topic_name = client.topic_path(project_id, topic_id)
topic_name = f"projects/{project_id}/topics/{topic_id}"
subscription_name = client.subscription_path(project_id, subscription_id)
success = True
try:
client.create_subscription(subscription_name, topic_name)
client.create_subscription({"name": subscription_name, "topic": topic_name})
except AlreadyExists:
# if subscription already exists, do nothing
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_pubsub(self):
client = SubscriberClient()
try:
topic_id = 'container-analysis-occurrences-v1'
topic_name = client.topic_path(PROJECT_ID, topic_id)
topic_name = {"name": f"projects/{PROJECT_ID}/topics/{topic_id}"}
publisher = PublisherClient()
publisher.create_topic(topic_name)
except AlreadyExists:
Expand Down Expand Up @@ -185,7 +185,7 @@ def test_pubsub(self):
assert message_count <= receiver.msg_count
finally:
# clean up
client.delete_subscription(subscription_name)
client.delete_subscription({"subscription": subscription_name})

def test_poll_discovery_occurrence(self):
# try with no discovery occurrence
Expand Down

0 comments on commit 4cf7bcf

Please sign in to comment.