Example #1
0
def test_file_from_to_url__posix(tmpdir):
    url = 'file://' + str(tmpdir)
    parsed = urlparse.urlparse(url)
    fs = FileSystemRepository.from_url(parsed)
    assert isinstance(fs, FileSystemRepository)
    assert fs.path == str(tmpdir)
    assert fs.to_url('file') == url
    assert fs.to_url('fs') == 'fs://' + str(tmpdir)
Example #2
0
def test_file_from_to_url(tmpdir):
    url = 'file://' + str(tmpdir)
    parsed = urlparse.urlparse(url)
    fs = FileSystemRepository.from_url(parsed)
    assert isinstance(fs, FileSystemRepository)
    assert fs.path == str(tmpdir)
    assert fs.to_url('file') == url
    assert fs.to_url('fs') == 'fs://' + str(tmpdir)
Example #3
0
def test_file_from_to_url__windows(tmpdir):
    url_tail = '/'.join(str(tmpdir).split(tmpdir.sep))
    url = 'file:///' + url_tail
    parsed = urlparse.urlparse(url)
    fs = FileSystemRepository.from_url(parsed)
    assert isinstance(fs, FileSystemRepository)
    assert fs.path == str(tmpdir)
    assert fs.to_url('file') == url
    assert fs.to_url('fs') == 'fs:///' + url_tail
Example #4
0
def test_file_from_to_url__windows(tmpdir):
    url_tail = '/'.join(str(tmpdir).split(tmpdir.sep))
    url = 'file:///' + url_tail
    parsed = urlparse.urlparse(url)
    fs = FileSystemRepository.from_url(parsed)
    assert isinstance(fs, FileSystemRepository)
    assert fs.path == str(tmpdir)
    assert fs.to_url('file') == url
    assert fs.to_url('fs') == 'fs:///' + url_tail