Skip to content

Commit feda187

Browse files
authored
1 parent 02fb2a1 commit feda187

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

google_auth_httplib2.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ def __init__(
184184
# credentials.refresh).
185185
self._request = Request(self.http)
186186

187+
def close(self):
188+
"""Calls httplib2's Http.close"""
189+
self.http.close()
190+
187191
def request(
188192
self,
189193
uri,

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616

1717
from setuptools import setup
1818

19-
2019
version = "0.0.4"
2120

22-
DEPENDENCIES = ["google-auth", "httplib2 >= 0.9.1", "six"]
21+
DEPENDENCIES = ["google-auth", "httplib2 >= 0.15.0", "six"]
2322

2423

2524
with io.open("README.rst", "r") as fh:

tests/test_google_auth_httplib2.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ def test_authed_http_defaults(self):
102102
assert authed_http.credentials == mock.sentinel.credentials
103103
assert isinstance(authed_http.http, httplib2.Http)
104104

105+
def test_close(self):
106+
with mock.patch("httplib2.Http.close", autospec=True) as close:
107+
authed_http = google_auth_httplib2.AuthorizedHttp(mock.sentinel.credentials)
108+
authed_http.close()
109+
110+
close.assert_called_once()
111+
105112
def test_connections(self):
106113
authed_http = google_auth_httplib2.AuthorizedHttp(mock.sentinel.credentials)
107114

0 commit comments

Comments
 (0)