FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Raise ValueError if credentials are not from google-auth (#2828) · googleapis/google-cloud-python@8097265 · GitHub

Commit 8097265

Browse files
Jon Wayne Parrott
authored
Raise ValueError if credentials are not from google-auth (#2828)
1 parent 6abb471 commit 8097265

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎packages/google-cloud-runtimeconfig/tox.ini‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ localdeps =
77
pip install --quiet --upgrade {toxinidir}/../core
88
deps =
99
{toxinidir}/../core
10+
mock
1011
pytest
1112
covercmd =
1213
py.test --quiet \

‎packages/google-cloud-runtimeconfig/unit_tests/test_client.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414

1515
import unittest
1616

17+
import mock
18+
19+
20+
def _make_credentials():
21+
import google.auth.credentials
22+
return mock.Mock(spec=google.auth.credentials.Credentials)
23+
1724

1825
class TestClient(unittest.TestCase):
1926

@@ -28,7 +35,7 @@ def _make_one(self, *args, **kw):
2835
def test_config(self):
2936
PROJECT = 'PROJECT'
3037
CONFIG_NAME = 'config_name'
31-
creds = object()
38+
creds = _make_credentials()
3239

3340
client_obj = self._make_one(project=PROJECT, credentials=creds)
3441
new_config = client_obj.config(CONFIG_NAME)

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL