GeezerVison is showing github.com — Add proxy to httplib2.Http.connections (#91) · googleapis/google-cloud-python@bb2f446
File tree
Expand file treeCollapse file tree
Open diff view settings
packages/google-auth/httplib2_transport
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/google-auth/httplib2_transport/google_auth_httplib2.py +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -223,3 +223,13 @@ def request(self, uri, method='GET', body=None, headers=None, |
223 | 223 | **kwargs) |
224 | 224 |
|
225 | 225 | return response, content |
| 226 | + |
| 227 | + @property |
| 228 | + def connections(self): |
| 229 | + """Proxy to httplib2.Http.connections.""" |
| 230 | + return self.http.connections |
| 231 | + |
| 232 | + @connections.setter |
| 233 | + def connections(self, value): |
| 234 | + """Proxy to httplib2.Http.connections.""" |
| 235 | + self.http.connections = value |
Collapse file
Copy file name to clipboardExpand all lines: packages/google-auth/httplib2_transport/setup.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
30 | 30 |
|
31 | 31 | setup( |
32 | 32 | name='google-auth-httplib2', |
33 | | - version='0.0.1', |
| 33 | + version='0.0.2', |
34 | 34 | author='Google Cloud Platform', |
35 | 35 | |
36 | 36 | description='Google Authentication Library', |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/google-auth/httplib2_transport/tests/test_google_auth_httplib2.py +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -86,6 +86,15 @@ def test_authed_http_defaults(self): |
86 | 86 | assert authed_http.credentials == mock.sentinel.credentials |
87 | 87 | assert isinstance(authed_http.http, httplib2.Http) |
88 | 88 |
|
| 89 | + def test_connections(self): |
| 90 | + authed_http = google_auth_httplib2.AuthorizedHttp( |
| 91 | + mock.sentinel.credentials) |
| 92 | + |
| 93 | + assert authed_http.connections == authed_http.http.connections |
| 94 | + |
| 95 | + authed_http.connections = mock.sentinel.connections |
| 96 | + assert authed_http.http.connections == mock.sentinel.connections |
| 97 | + |
89 | 98 | def test_request_no_refresh(self): |
90 | 99 | mock_credentials = mock.Mock(wraps=MockCredentials()) |
91 | 100 | mock_response = MockResponse() |
|