def test_decorator_from_client_secrets_with_optional_settings(self):
# Test that the decorator works with the absense of a revoke_uri in
# the client secrets.
loadfile_patch = mock.patch(
'oauth2client.contrib.appengine.clientsecrets.loadfile')
with loadfile_patch as loadfile_mock:
loadfile_mock.return_value = (clientsecrets.TYPE_WEB, {
'client_id': 'foo_client_id',
'client_secret': 'foo_client_secret',
'redirect_uris': [],
'auth_uri': oauth2client.GOOGLE_AUTH_URI,
'token_uri': oauth2client.GOOGLE_TOKEN_URI,
# No revoke URI
})
decorator = appengine.OAuth2DecoratorFromClientSecrets(
'doesntmatter.json',
scope=['foo_scope', 'bar_scope'])
self.assertEqual(decorator._revoke_uri, oauth2client.GOOGLE_REVOKE_URI)
# This is never set, but it's consistent with other tests.
self.assertFalse(decorator._in_error)
test_appengine.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录