How to use the rfc3986.parseresult function in rfc3986

To help you get started, we’ve selected a few rfc3986 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github python-hyper / rfc3986 / tests / test_parseresult.py View on Github external
def test_parse_result_encodes_itself(uri_with_everything):
    uri = pr.ParseResult.from_string(uri_with_everything)
    uribytes = uri.encode()
    encoding = uri.encoding
    assert uri.scheme.encode(encoding) == uribytes.scheme
    assert uri.userinfo.encode(encoding) == uribytes.userinfo
    assert uri.host.encode(encoding) == uribytes.host
    assert uri.port == uribytes.port
    assert uri.path.encode(encoding) == uribytes.path
    assert uri.query.encode(encoding) == uribytes.query
    assert uri.fragment.encode(encoding) == uribytes.fragment
github python-hyper / rfc3986 / tests / test_parseresult.py View on Github external
def test_raises_invalid_port_non_strict_parse(self, port):
        with pytest.raises(exceptions.InvalidPort):
            pr.ParseResultBytes.from_string(
                "https://httpbin.org:{0}/get".format(port), strict=False
            )