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_encode_iri(iri, uri):
assert rfc3986.iri_reference(iri).encode().unsplit() == uri
def test_iri_equality_special_cases():
assert rfc3986.iri_reference(u"http://Bü:ẞ@βόλος.com/β/ό?λ#ος") == (
u"http",
u"Bü:ẞ@βόλος.com",
u"/%CE%B2/%CF%8C",
u"%CE%BB",
u"%CE%BF%CF%82",
)
with pytest.raises(TypeError):
rfc3986.iri_reference(u"http://ẞ.com") == 1
def test_iri_equality(iri, uri):
assert rfc3986.iri_reference(iri) == iri
def test_iri_equality_special_cases():
assert rfc3986.iri_reference(u"http://Bü:ẞ@βόλος.com/β/ό?λ#ος") == (
u"http",
u"Bü:ẞ@βόλος.com",
u"/%CE%B2/%CF%8C",
u"%CE%BB",
u"%CE%BF%CF%82",
)
with pytest.raises(TypeError):
rfc3986.iri_reference(u"http://ẞ.com") == 1
def test_encode_invalid_iri(iri):
iri_ref = rfc3986.iri_reference(iri)
with pytest.raises(InvalidAuthority):
iri_ref.encode()