示例#1
0
def test_handle_http_error_404_handling():
    with pytest.raises(HTTPError, match="invalid id"):
        handle_http_error(404)
示例#2
0
def test_handle_http_error_no_error():
    assert handle_http_error(200) is None
    assert handle_http_error(302) is None
示例#3
0
def test_handle_http_error():
    with pytest.raises(HTTPError):
        handle_http_error(400)
    with pytest.raises(HTTPError):
        handle_http_error(500)