-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Factor out API helper classes from 'pubsub.Connection'. #1736
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
Factor out API helper classes from 'pubsub.Connection'. #1736
Conversation
These API objects will represent logical groupings of the JSON api endpoints, and correspond one-for-one to the stubs exposed by the generated gRPC code. Further commits will move the endpoint-specific methods from the 'Connecttion' class into the relevant API classes, and adjust the callers. See: #1700 (comment)
| def publisher_api(self): | ||
| """Helper for publisher-related API calls.""" | ||
| if self._publisher_api is None: | ||
| self._publisher_api = _PublisherAPI(self.connection) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
For non-test code, ISTM the only change after the cut-and-paste was |
| self.assertEqual(conn.build_api_url('/foo', api_base_url=base_url2), | ||
| URI) | ||
|
|
||
| def _verify_uri(self, uri, expected_path, **expected_qs): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@tseaver LGTM save for my |
For the helper objects, yes. The callers now delegate to the methods of the helpers, rather than the connection. |
|
@tseaver You jumped the gun a bit on the merge. I have an unanswered question:
regarding setting test connections to |
|
141eab5 removed them. |
|
I'm seeing conn = client.connection = object()on line 36 of Instead of |
Co-authored-by: Anthonios Partheniou <[email protected]>
Uses #1700 as a base.Toward #851 / #1696.