Skip to content

Commit

Permalink
fix: pass updated keyword args to Publisher/Subscriber client in goog…
Browse files Browse the repository at this point in the history
…le/pubsub
  • Loading branch information
Mohsin-Ul-Islam committed May 22, 2022
1 parent df0c28a commit 7717d76
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions testcontainers/google/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@ def _get_channel(self, channel=None):

def get_publisher_client(self, **kwargs):
from google.cloud import pubsub
kwargs['channel'] = self._get_channel(kwargs.get('channel'))
from google.auth import credentials
kwargs['client_options'] = dict(api_endpoint=self.get_pubsub_emulator_host())
kwargs['credentials'] = credentials.AnonymousCredentials()
return pubsub.PublisherClient(**kwargs)

def get_subscriber_client(self, **kwargs):
from google.cloud import pubsub
kwargs['channel'] = self._get_channel(kwargs.get('channel'))
from google.auth import credentials
kwargs['client_options'] = dict(api_endpoint=self.get_pubsub_emulator_host())
kwargs['credentials'] = credentials.AnonymousCredentials()
return pubsub.SubscriberClient(**kwargs)

0 comments on commit 7717d76

Please sign in to comment.