diff --git a/runtimeconfig/google/cloud/runtimeconfig/client.py b/runtimeconfig/google/cloud/runtimeconfig/client.py index 0dc95e655dd8..1f40b62895a5 100644 --- a/runtimeconfig/google/cloud/runtimeconfig/client.py +++ b/runtimeconfig/google/cloud/runtimeconfig/client.py @@ -42,11 +42,13 @@ class Client(ClientWithProject): ``credentials`` for the current object. """ + SCOPE = ('https://www.googleapis.com/auth/cloudruntimeconfig',) + """The scopes required for authenticating as a RuntimeConfig consumer.""" + def __init__(self, project=None, credentials=None, http=None): super(Client, self).__init__( project=project, credentials=credentials, http=http) - self._connection = Connection( - credentials=self._credentials, http=self._http) + self._connection = Connection(self) def config(self, config_name): """Factory constructor for config object. diff --git a/runtimeconfig/google/cloud/runtimeconfig/connection.py b/runtimeconfig/google/cloud/runtimeconfig/connection.py index 5074158c5f47..91f1fde77983 100644 --- a/runtimeconfig/google/cloud/runtimeconfig/connection.py +++ b/runtimeconfig/google/cloud/runtimeconfig/connection.py @@ -42,6 +42,3 @@ class Connection(_http.JSONConnection): API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}' """A template for the URL of a particular API call.""" - - SCOPE = ('https://www.googleapis.com/auth/cloudruntimeconfig',) - """The scopes required for authenticating as a RuntimeConfig consumer.""" diff --git a/runtimeconfig/unit_tests/test_connection.py b/runtimeconfig/unit_tests/test_connection.py index e8fe17a439fe..c89465fc0603 100644 --- a/runtimeconfig/unit_tests/test_connection.py +++ b/runtimeconfig/unit_tests/test_connection.py @@ -27,6 +27,6 @@ def _make_one(self, *args, **kw): return self._get_target_class()(*args, **kw) def test_default_url(self): - creds = object() - conn = self._make_one(creds) - self.assertEqual(conn.credentials, creds) + client = object() + conn = self._make_one(client) + self.assertIs(conn._client, client)