Exemple #1
0
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'
Exemple #2
0
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)
Exemple #3
0
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)
Exemple #4
0
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'
Exemple #5
0
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'
Exemple #6
0
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)
Exemple #7
0
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)
Exemple #8
0
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'