Skip to content

Conversation

@theacodes
Copy link
Contributor

No description provided.



class Response(transport.Response):
"""http.client transport request adapter."""

This comment was marked as spam.

This comment was marked as spam.

key.lower(): value for key, value in response.getheaders()}
self._data = response.read()

@property

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

class Request(transport.Request):
"""http.client transport request adapter."""
def __init__(self):
pass

This comment was marked as spam.

This comment was marked as spam.

Raises:
google.auth.exceptions.TransportError: If any exception occurred.
"""
# socket._GLOBAL_DEFAULT_TIMEOUT is the default in http.client.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

path = urllib.parse.urlunsplit(
('', '', parts.path, parts.query, parts.fragment))

connection = http_client.HTTPConnection(parts.netloc)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

def server(self):
"""Provides a test HTTP server that is automatically created before
a test and destroyed at the end. The server is serving a test
application that can be used to verify requests."""

This comment was marked as spam.

This comment was marked as spam.

# pylint: disable=unused-variable
# (pylint thinks the flask routes are unusued.)
app = flask.Flask(__name__)
app.debug = True

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

def index():
return 'Basic Content', http_client.OK, {
'X-Test-Header': flask.request.headers.get(
'x-test-header', 'value')}

This comment was marked as spam.

This comment was marked as spam.

@theacodes theacodes added this to the 1.0.0 milestone Oct 6, 2016
wrong-import-position,
no-name-in-module,
locally-disabled,
locally-enabled,

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

# pylint: disable=unused-variable
# (pylint thinks the flask routes are unusued.)
app = flask.Flask(__name__)
app.debug = True

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Oct 7, 2016

Still remaining:

  • Me understanding what locally-enabled does
  • Raising for non-http schemes in the http_client impl.
  • Using remove= instead of the None means delete behavior in the query params replace (or another alternative based on our discussion)

@theacodes
Copy link
Contributor Author

Me understanding what locally-enabled does

I think I cleared that up.

Raising for non-http schemes in the http_client impl.

Done.

Using remove= instead of the None means delete behavior in the query params replace (or another alternative based on our discussion)

Does the new examples in the docstring help here? Do you feel strongly that remove should be a separate argument?

@dhermes
Copy link
Contributor

dhermes commented Oct 7, 2016

Do you feel strongly that remove should be a separate argument?

Yes. Just because Python let's us allow any-old type in doesn't mean it's a good API for users.

@theacodes theacodes merged commit 0178246 into master Oct 7, 2016
@theacodes theacodes deleted the http-client-transport branch October 7, 2016 21:05
@theacodes theacodes mentioned this pull request Oct 21, 2016
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants