test_appengine.py 文件源码

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

项目:REMAP 作者: REMAPApp 项目源码 文件源码
def test_decorator_from_client_secrets_bad_type(self):
        # NOTE: this code path is not currently reachable, as the only types
        # that oauth2client.clientsecrets can load is web and installed, so
        # this test forces execution of this code path. Despite not being
        # normally reachable, this should remain in case future types of
        # credentials are added.

        loadfile_patch = mock.patch(
            'oauth2client.contrib.appengine.clientsecrets.loadfile')
        with loadfile_patch as loadfile_mock:
            loadfile_mock.return_value = ('badtype', None)
            with self.assertRaises(clientsecrets.InvalidClientSecretsError):
                appengine.OAuth2DecoratorFromClientSecrets(
                    'doesntmatter.json',
                    scope=['foo_scope', 'bar_scope'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号