Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1129)

Unified Diff: tests/test_oauth2client_appengine.py

Issue 60300043: Permit AppAssertionCredentials to specify the service account to use
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « oauth2client/appengine.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test_oauth2client_appengine.py
===================================================================
--- a/tests/test_oauth2client_appengine.py
+++ b/tests/test_oauth2client_appengine.py
@@ -203,6 +203,23 @@
'http://www.googleapis.com/scope http://www.googleapis.com/scope2',
credentials.scope)
+ def test_custom_service_account(self):
+ scope = "http://www.googleapis.com/scope"
+ account_id = "service_account_name_2@appspot.com"
+ m = mox.Mox()
+ m.StubOutWithMock(app_identity, 'get_access_token')
+ app_identity.get_access_token(
+ [scope], service_account_id=account_id).AndReturn(('a_token_456', None))
+ m.ReplayAll()
+
+ credentials = AppAssertionCredentials(scope, service_account_id=account_id)
+ http = httplib2.Http()
+ credentials.refresh(http)
+ m.VerifyAll()
+ m.UnsetStubs()
+ self.assertEqual('a_token_456', credentials.access_token)
+ self.assertEqual(scope, credentials.scope)
+
class TestFlowModel(db.Model):
flow = FlowProperty()
« no previous file with comments | « oauth2client/appengine.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b