Esempio n. 1
0
def test_raise_for_undefined_status():
    r = Response(version='1.5', status_code=999, message='')

    with pytest.raises(ResponseException):
        r.raise_for_status()
Esempio n. 2
0
def test_raise_for_status_ok():
    r = Response(version='1.5', status_code=Status.EX_OK, message='')

    assert r.raise_for_status() is None
Esempio n. 3
0
def test_raise_for_status(test_input):
    r = Response(version='1.5', status_code=test_input, message='')

    with pytest.raises(test_input.exception):
        r.raise_for_status()