Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_strict_urlparsing():
with pytest.raises(exceptions.InvalidAuthority):
parseresult.ParseResult.from_string(SNOWMAN_HOST)
def test_raises_invalid_authority_for_invalid_uris(self, invalid_uri):
with pytest.raises(exceptions.InvalidAuthority):
pr.ParseResultBytes.from_string(invalid_uri)
def test_encode_invalid_iri(iri):
iri_ref = rfc3986.iri_reference(iri)
with pytest.raises(InvalidAuthority):
iri_ref.encode()
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()