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