Example #1
0
def test_global_to_local_master():
    c = URLConverter('myhost', 42, '/my/path')
    master = 'server:8080'

    url = c.global_to_local('http:///xyz.txt', master)
    assert url == 'http://server:8080/xyz.txt'
Example #2
0
def test_local_to_global_outside_dir():
    c = URLConverter('myhost', 42, '/my/path')

    url = c.local_to_global('/other/path/xyz.txt')
    assert url == '/other/path/xyz.txt'
Example #3
0
def test_local_to_global():
    c = URLConverter('myhost', 42, '/my/path')

    url = c.local_to_global('/my/path/xyz.txt')
    assert url == 'http://myhost:42/xyz.txt'