Example #1
0
def test_check_http_version():
    _check_http_version(b"HTTP/0.9")
    _check_http_version(b"HTTP/1.0")
    _check_http_version(b"HTTP/1.1")
    _check_http_version(b"HTTP/2.0")
    with raises(exceptions.HttpSyntaxException):
        _check_http_version(b"WTF/1.0")
    with raises(exceptions.HttpSyntaxException):
        _check_http_version(b"HTTP/1.10")
    with raises(exceptions.HttpSyntaxException):
        _check_http_version(b"HTTP/1.b")
Example #2
0
def test_check_http_version():
    _check_http_version(b"HTTP/0.9")
    _check_http_version(b"HTTP/1.0")
    _check_http_version(b"HTTP/1.1")
    _check_http_version(b"HTTP/2.0")
    with pytest.raises(exceptions.HttpSyntaxException):
        _check_http_version(b"WTF/1.0")
    with pytest.raises(exceptions.HttpSyntaxException):
        _check_http_version(b"HTTP/1.10")
    with pytest.raises(exceptions.HttpSyntaxException):
        _check_http_version(b"HTTP/1.b")