Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.8k
Allows Explicitly Enabling/Disabling GAX for Logging/Pubsub#2553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -34,18 +34,33 @@ def test_publisher_api_wo_gax(self): | ||
| from google.cloud.pubsub import client as MUT | ||
| from google.cloud._testing import _Monkey | ||
| creds = _Credentials() | ||
| client = self._makeOne(project=self.PROJECT, credentials=creds) | ||
| conn = client.connection = object() | ||
| with _Monkey(MUT, _USE_GAX=False): | ||
| api = client.publisher_api | ||
| client = self._makeOne(project=self.PROJECT, credentials=creds) | ||
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page.
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page. | ||
| conn = client.connection = object() | ||
| api = client.publisher_api | ||
| self.assertIsInstance(api, _PublisherAPI) | ||
| self.assertIs(api._connection, conn) | ||
| # API instance is cached | ||
| again = client.publisher_api | ||
| self.assertIs(again, api) | ||
| def test_no_gax_ctor(self): | ||
| from google.cloud._testing import _Monkey | ||
| from google.cloud.pubsub.connection import _PublisherAPI | ||
| from google.cloud.pubsub import client as MUT | ||
| creds = _Credentials() | ||
| with _Monkey(MUT, _USE_GAX=True): | ||
| client = self._makeOne(project=self.PROJECT, credentials=creds, | ||
| use_gax=False) | ||
| self.assertFalse(client._use_gax) | ||
| api = client.publisher_api | ||
| self.assertIsInstance(api, _PublisherAPI) | ||
| def test_publisher_api_w_gax(self): | ||
| from google.cloud.pubsub import client as MUT | ||
| from google.cloud._testing import _Monkey | ||
| @@ -84,11 +99,12 @@ def test_subscriber_api_wo_gax(self): | ||
| from google.cloud.pubsub import client as MUT | ||
| from google.cloud._testing import _Monkey | ||
| creds = _Credentials() | ||
| client = self._makeOne(project=self.PROJECT, credentials=creds) | ||
| conn = client.connection = object() | ||
| with _Monkey(MUT, _USE_GAX=False): | ||
| api = client.subscriber_api | ||
| client = self._makeOne(project=self.PROJECT, credentials=creds) | ||
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page.
This comment was marked as spam.Sorry, something went wrong. Uh oh!There was an error while loading. Please reload this page. | ||
| conn = client.connection = object() | ||
| api = client.subscriber_api | ||
| self.assertIsInstance(api, _SubscriberAPI) | ||
| self.assertIs(api._connection, conn) | ||
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.