Beispiel #1
0
def test_suffix_normalize():
    for suffix, expected in REL_URL_TEST_CASES:
        url = URL(REL_URL_BASE)
        url.normalize(suffix)
        assert url.path == URL(expected).path

    return
Beispiel #2
0
def test_normalize_with_case():
    # from RFC 3986 Section 6.2.2
    url1 = URL('example://a/b/c/%7Bfoo%7D')
    url2 = URL('eXAMPLE://a/./b/../b/%63/%7bfoo%7d')

    assert url1 != url2

    url1.normalize()
    url2.normalize()

    assert url1 == url2
Beispiel #3
0
def test_self_normalize():
    url = URL('http://hatnote.com/a/../../b?k=v#hashtags')
    url.normalize()
    assert url.to_text() == 'http://hatnote.com/b?k=v#hashtags'