How to use the rfc3986.exceptions.InvalidAuthority 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_unicode_support.py View on Github external
def test_strict_urlparsing():
    with pytest.raises(exceptions.InvalidAuthority):
        parseresult.ParseResult.from_string(SNOWMAN_HOST)
github python-hyper / rfc3986 / tests / test_parseresult.py View on Github external
def test_raises_invalid_authority_for_invalid_uris(self, invalid_uri):
        with pytest.raises(exceptions.InvalidAuthority):
            pr.ParseResultBytes.from_string(invalid_uri)
github python-hyper / rfc3986 / tests / test_iri.py View on Github external
def test_encode_invalid_iri(iri):
    iri_ref = rfc3986.iri_reference(iri)
    with pytest.raises(InvalidAuthority):
        iri_ref.encode()
github python-hyper / rfc3986 / tests / test_uri.py View on Github external
def test_authority_info_raises_InvalidAuthority(self, invalid_uri):
        """Test that an invalid IPv6 is caught by authority_info()."""
        uri = URIReference.from_string(invalid_uri)
        with pytest.raises(InvalidAuthority):
            uri.authority_info()