Skip to content

Commit

Permalink
Add proxy to httplib2.Http.connections (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Wayne Parrott committed Dec 2, 2016
1 parent 4c883f0 commit d840bec
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
10 changes: 10 additions & 0 deletions httplib2_transport/google_auth_httplib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,13 @@ def request(self, uri, method='GET', body=None, headers=None,
**kwargs)

return response, content

@property
def connections(self):
"""Proxy to httplib2.Http.connections."""
return self.http.connections

@connections.setter
def connections(self, value):
"""Proxy to httplib2.Http.connections."""
self.http.connections = value
2 changes: 1 addition & 1 deletion httplib2_transport/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

setup(
name='google-auth-httplib2',
version='0.0.1',
version='0.0.2',
author='Google Cloud Platform',
author_email='[email protected]',
description='Google Authentication Library',
Expand Down
9 changes: 9 additions & 0 deletions httplib2_transport/tests/test_google_auth_httplib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ def test_authed_http_defaults(self):
assert authed_http.credentials == mock.sentinel.credentials
assert isinstance(authed_http.http, httplib2.Http)

def test_connections(self):
authed_http = google_auth_httplib2.AuthorizedHttp(
mock.sentinel.credentials)

assert authed_http.connections == authed_http.http.connections

authed_http.connections = mock.sentinel.connections
assert authed_http.http.connections == mock.sentinel.connections

def test_request_no_refresh(self):
mock_credentials = mock.Mock(wraps=MockCredentials())
mock_response = MockResponse()
Expand Down

0 comments on commit d840bec

Please sign in to comment.