def test_equiv_keys(): '''value of 2 equivalent keys''' uris = irihelper.uridict() uris['file:///path/to/resource'] = 1 uris['file://localhost/path/to/resource'] = 2 assert 2 == uris[ 'file:///path/to/resource'], 'RFC 1738 localhost support failed'
def test_percent_encoding_equivalence(uri, expected): '''percent-encoding equivalence''' uris = irihelper.uridict() uris[uri] = 1 uris[expected] = 2 assert 2 == uris[uri], '%s and %s equivalence' % (uri, expected)
def test_case_normalization(uri, expected, junk): '''case normalization''' uris = irihelper.uridict() uris[uri] = 1 uris[expected] = 2 assert 2 == uris[uri], '%s and %s equivalence' % (uri, expected)
def test_equiv_keys(): '''value of 2 equivalent keys''' uris = irihelper.uridict() uris['file:///path/to/resource'] = 1 uris['file://localhost/path/to/resource'] = 2 assert 2 == uris['file:///path/to/resource'], 'RFC 1738 localhost support failed'
def test_uri_dict(): '''equivalent key in UriDict''' uris = irihelper.uridict() uris['file:///path/to/resource'] = 0 assert 'file://localhost/path/to/resource' in uris, 'RFC 1738 localhost support failed'