diff options
author | Danny Hermes <daniel.j.hermes@gmail.com> | 2016-02-04 18:45:20 -0800 |
---|---|---|
committer | Danny Hermes <daniel.j.hermes@gmail.com> | 2016-02-04 18:45:20 -0800 |
commit | 91b3c614509be22a3b5f2ab72ae99e5d890c13fe (patch) | |
tree | fc6be7c22c34c178a7c5f42ecee9d8400d7fec66 /tests/test_client.py | |
parent | 7c6938c0ac9391363e90b28f16f1e55418666bf4 (diff) | |
download | oauth2client-91b3c614509be22a3b5f2ab72ae99e5d890c13fe.tar.gz |
Make _ServiceAccountCredentials public.
Also
- changing the svc. acct. creds constructor to take a signer
- adding two factory constructors to build from a JSON keyfile
(either by filename or already parsed)
- adding helpers to avoid re-loading file contents or re-parsing
JSON when constructing svc. acct. creds from the main
`client` module
Diffstat (limited to 'tests/test_client.py')
-rw-r--r-- | tests/test_client.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_client.py b/tests/test_client.py index 708db4d..1787bcc 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -80,7 +80,7 @@ from oauth2client.client import credentials_from_code from oauth2client.client import flow_from_clientsecrets from oauth2client.client import save_to_well_known_file from oauth2client.clientsecrets import _loadfile -from oauth2client.service_account import _ServiceAccountCredentials +from oauth2client.service_account import ServiceAccountCredentials __author__ = 'jcgregorio@google.com (Joe Gregorio)' @@ -157,8 +157,8 @@ class GoogleCredentialsTests(unittest2.TestCase): os.environ.pop(env, None) def validate_service_account_credentials(self, credentials): - self.assertTrue(isinstance(credentials, _ServiceAccountCredentials)) - self.assertEqual('123', credentials._service_account_id) + self.assertTrue(isinstance(credentials, ServiceAccountCredentials)) + self.assertEqual('123', credentials.client_id) self.assertEqual('dummy@google.com', credentials._service_account_email) self.assertEqual('ABCDEF', credentials._private_key_id) @@ -619,8 +619,8 @@ class GoogleCredentialsTests(unittest2.TestCase): credentials_file) def test_to_from_json_authorized_user(self): - credentials_file = datafile( - os.path.join('gcloud', 'application_default_credentials_authorized_user.json')) + filename = 'application_default_credentials_authorized_user.json' + credentials_file = datafile(os.path.join('gcloud', filename)) creds = GoogleCredentials.from_stream(credentials_file) json = creds.to_json() creds2 = GoogleCredentials.from_json(json) |