Skip to content

Commit

Permalink
made unit tests compatible with google-api-python-client 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cnelson committed Oct 16, 2015
1 parent 4bb5051 commit 572685c
Show file tree
Hide file tree
Showing 5 changed files with 308 additions and 312 deletions.
3 changes: 2 additions & 1 deletion fleet/v1/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def __init__(self, endpoint, http=None):
self._service = build(
self._API,
self._VERSION,
cache_discovery=False,
discoveryServiceUrl=discovery_url,
http=self._http
)
Expand Down Expand Up @@ -123,7 +124,7 @@ def _single_request(self, method, *args, **kwargs):
try:
return _method.execute(http=self._http)
except googleapiclient.errors.HttpError as exc:
response = json.loads(exc.content)['error']
response = json.loads(exc.content.decode('utf-8'))['error']

raise APIError(code=response['code'], message=response['message'], http_error=exc)

Expand Down
Empty file.
4 changes: 2 additions & 2 deletions fleet/v1/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def test_init_endpoint_active_but_invalid(self):
def test():

http = HttpMock(
None,
{'status': '404'}
os.path.join(self._BASE_DIR, 'fixtures/empty_response.txt'),
{'status': '404'},
)

Client(self.endpoint, http=http)
Expand Down
Loading

0 comments on commit 572685c

Please sign in to comment.