Exemplo n.º 1
0
def test_url_canonicalizer_want_all():
    v = URLCanonicalizer(discard_parts=())
    el = scalar(u'http://*****:*****@there/path#fragment')
    eq_(el.value, u'http://*****:*****@there/path#fragment')

    assert v.validate(el, None)
    eq_(el.value, u'http://*****:*****@there/path#fragment')
    assert not el.errors
Exemplo n.º 2
0
def test_url_canonicalizer_default():
    v = URLCanonicalizer()
    el = scalar(u'http://localhost/#foo')
    eq_(el.value, u'http://localhost/#foo')

    assert v.validate(el, None)
    eq_(el.value, u'http://localhost/')
    assert not el.errors