test_appengine.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:deb-python-oauth2client 作者: openstack 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号