Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Commit

Permalink
Fixing broken tests (commit will be squashed).
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes committed Feb 17, 2016
1 parent 31abfe6 commit a31f512
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/contrib/test_gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_to_json_and_from_json(self):

def _refresh_success_helper(self, bytes_response=False):
access_token = u'this-is-a-token'
return_val = json.dumps({u'accessToken': access_token})
return_val = json.dumps({u'access_token': access_token})
if bytes_response:
return_val = _to_bytes(return_val)
http = mock.MagicMock()
Expand All @@ -69,7 +69,7 @@ def _refresh_success_helper(self, bytes_response=False):

base_metadata_uri = (
'http://metadata.google.internal/computeMetadata/v1/instance/'
'service-accounts/default/acquire')
'service-accounts/default/token')
escaped_scopes = urllib.parse.quote(' '.join(scopes), safe='')
request_uri = base_metadata_uri + '?scope=' + escaped_scopes
http.request.assert_called_once_with(
Expand Down Expand Up @@ -153,7 +153,7 @@ def test_get_access_token(self):
http = mock.MagicMock()
http.request = mock.MagicMock(
return_value=(mock.Mock(status=http_client.OK),
'{"accessToken": "this-is-a-token"}'))
'{"access_token": "this-is-a-token"}'))

credentials = AppAssertionCredentials(['dummy_scope'])
token = credentials.get_access_token(http=http)
Expand All @@ -162,7 +162,7 @@ def test_get_access_token(self):

http.request.assert_called_once_with(
'http://metadata.google.internal/computeMetadata/v1/instance/'
'service-accounts/default/acquire?scope=dummy_scope',
'service-accounts/default/token?scope=dummy_scope',
headers={'Metadata-Flavor': 'Google'})

def test_save_to_well_known_file(self):
Expand Down

0 comments on commit a31f512

Please sign in to comment.