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
评论列表
文章目录