Skip to content

Conversation

@tseaver
Copy link
Contributor

@tseaver tseaver commented Apr 22, 2016

Uses #1700 as a base.

Toward #851 / #1696.

@tseaver tseaver added the api: pubsub Issues related to the Pub/Sub API. label Apr 22, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 22, 2016
tseaver added 6 commits April 22, 2016 12:14
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)
@tseaver
Copy link
Contributor Author

tseaver commented Apr 22, 2016

@dhermes Rebased after merging #1700 to master. PTAL

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.

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Apr 22, 2016

For non-test code, ISTM the only change after the cut-and-paste was self.api_request -> self.conn.api_request (and synonyms). Is that correct?

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.

@dhermes
Copy link
Contributor

dhermes commented Apr 22, 2016

@tseaver LGTM save for my two three clarifications requested.

@tseaver
Copy link
Contributor Author

tseaver commented Apr 22, 2016

For non-test code, ISTM the only change after the cut-and-paste was self.api_request -> self.conn.api_request (and synonyms). Is that correct?

For the helper objects, yes. The callers now delegate to the methods of the helpers, rather than the connection.

@tseaver tseaver merged commit d97cffe into googleapis:master Apr 22, 2016
@tseaver tseaver deleted the 851-1696-pubsub-api_helper_classes branch April 22, 2016 18:01
@dhermes
Copy link
Contributor

dhermes commented Apr 22, 2016

@tseaver You jumped the gun a bit on the merge. I have an unanswered question:

Why couldn't those lines just be deleted?

regarding setting test connections to object(). Why do they need to be set at all?

@tseaver
Copy link
Contributor Author

tseaver commented Apr 22, 2016

141eab5 removed them.

@dhermes
Copy link
Contributor

dhermes commented Apr 22, 2016

I'm seeing

conn = client.connection = object()

on line 36 of gcloud/pubsub/test_client.py. Lines like that are ones I am curious about.

Instead of self.assertTrue(api._connection is conn) you could use self.assertIsNone(api._connection)

parthea added a commit that referenced this pull request Nov 24, 2025
Co-authored-by: Anthonios Partheniou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants