def test_handle_raises_error_if_status_is_400(api_call):
responses.add(api_call.method, api_call.url, body=HTTPError())
with raises(HTTPError):
handle(api_call())
# @responses.activate
# @mark.parametrize('api_call', api_calls)
# def test_call_endpoint_with_query_parameters(api_call):
# responses.add(
# api_call.method,
# api_call.url + '?spam=eggs&foo=bar',
# match_querystring=False
# )
# params = dict(foo='bar', spam='eggs')
# assert api_call(params=params).status_code == 200
评论列表
文章目录