Ejemplo n.º 1
0
def test_parse_authority_form():
    assert _parse_authority_form(b"foo:42") == (b"foo", 42)
    assert _parse_authority_form(b"[2001:db8:42::]:443") == (b"2001:db8:42::", 443)
    with pytest.raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo")
    with pytest.raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo:bar")
    with pytest.raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo:99999999")
    with pytest.raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"f\x00oo:80")
Ejemplo n.º 2
0
def test_parse_authority_form():
    assert _parse_authority_form(b"foo:42") == (b"foo", 42)
    assert _parse_authority_form(b"[2001:db8:42::]:443") == (b"2001:db8:42::",
                                                             443)
    with pytest.raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo")
    with pytest.raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo:bar")
    with pytest.raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo:99999999")
    with pytest.raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"f\x00oo:80")
Ejemplo n.º 3
0
def test_parse_authority_form():
    assert _parse_authority_form(b"foo:42") == (b"foo", 42)
    with raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo")
    with raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo:bar")
    with raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo:99999999")
    with raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"f\x00oo:80")
Ejemplo n.º 4
0
def test_parse_authority_form():
    assert _parse_authority_form(b"foo:42") == (b"foo", 42)
    with raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo")
    with raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo:bar")
    with raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"foo:99999999")
    with raises(exceptions.HttpSyntaxException):
        _parse_authority_form(b"f\x00oo:80")