-
Notifications
You must be signed in to change notification settings - Fork 346
Add http.client transport #10
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
Conversation
|
|
||
|
|
||
| class Response(transport.Response): | ||
| """http.client transport request adapter.""" |
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.
| 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.
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.
| 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| 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.
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.
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.
| 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.
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
tests/transport/compliance.py
Outdated
| 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| # 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.
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.
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
tests/transport/compliance.py
Outdated
| 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| wrong-import-position, | ||
| no-name-in-module, | ||
| locally-disabled, | ||
| locally-enabled, |
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.
| # 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.
Sorry, something went wrong.
|
Still remaining:
|
I think I cleared that up.
Done.
Does the new examples in the docstring help here? 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. |
No description provided.