rpc_test.py 文件源码

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

项目:appbackendapi 作者: codesdk 项目源码 文件源码
def test_url_fetch_rpc_error(urlfetch_mock, app):
    urlfetch_mock.DownloadError = urlfetch.DownloadError
    get_result_mock = mock.Mock(
        side_effect=urlfetch.DownloadError())
    urlfetch_mock.create_rpc = mock.Mock(
        return_value=mock.Mock(get_result=get_result_mock))
    response = app.get('/', status=500)
    assert 'Error fetching URL' in response.body
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号