How to use the rfc3986.iri_reference 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_iri.py View on Github external
def test_encode_iri(iri, uri):
    assert rfc3986.iri_reference(iri).encode().unsplit() == uri
github python-hyper / rfc3986 / tests / test_iri.py View on Github external
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
github python-hyper / rfc3986 / tests / test_iri.py View on Github external
def test_iri_equality(iri, uri):
    assert rfc3986.iri_reference(iri) == iri
github python-hyper / rfc3986 / tests / test_iri.py View on Github external
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
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()