Skip to content

Commit c91fa4a

Browse files
committed
Changing runtimeconfig Connection to only accept client.
1 parent f0adea3 commit c91fa4a

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

runtimeconfig/google/cloud/runtimeconfig/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@ class Client(ClientWithProject):
4242
``credentials`` for the current object.
4343
"""
4444

45+
SCOPE = ('https://www.googleapis.com/auth/cloudruntimeconfig',)
46+
"""The scopes required for authenticating as a RuntimeConfig consumer."""
47+
4548
def __init__(self, project=None, credentials=None, http=None):
4649
super(Client, self).__init__(
4750
project=project, credentials=credentials, http=http)
48-
self._connection = Connection(
49-
credentials=self._credentials, http=self._http)
51+
self._connection = Connection(self)
5052

5153
def config(self, config_name):
5254
"""Factory constructor for config object.

runtimeconfig/google/cloud/runtimeconfig/connection.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,3 @@ class Connection(_http.JSONConnection):
4242

4343
API_URL_TEMPLATE = '{api_base_url}/{api_version}{path}'
4444
"""A template for the URL of a particular API call."""
45-
46-
SCOPE = ('https://www.googleapis.com/auth/cloudruntimeconfig',)
47-
"""The scopes required for authenticating as a RuntimeConfig consumer."""

runtimeconfig/unit_tests/test_connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ def _make_one(self, *args, **kw):
2727
return self._get_target_class()(*args, **kw)
2828

2929
def test_default_url(self):
30-
creds = object()
31-
conn = self._make_one(creds)
32-
self.assertEqual(conn.credentials, creds)
30+
client = object()
31+
conn = self._make_one(client)
32+
self.assertIs(conn._client, client)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy