From a31f512651bd4d414e71c8b31fbf7a24617a5876 Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Wed, 17 Feb 2016 10:22:56 -0800 Subject: [PATCH] Fixing broken tests (commit will be squashed). --- tests/contrib/test_gce.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/contrib/test_gce.py b/tests/contrib/test_gce.py index add4231db..ff2a1b3f3 100644 --- a/tests/contrib/test_gce.py +++ b/tests/contrib/test_gce.py @@ -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() @@ -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( @@ -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) @@ -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):