Пример #1
0
def test_path_to_url_win():
    assert path_to_url("c:/tmp/file") == "file:///c:/tmp/file"
    assert path_to_url("c:\\tmp\\file") == "file:///c:/tmp/file"
    assert path_to_url(r"\\unc\as\path") == "file://unc/as/path"
    path = Path(".") / "file"
    assert path_to_url("file") == "file:///" + path.absolute().as_posix()
Пример #2
0
def test_path_to_url_unix():
    assert path_to_url("/tmp/file") == "file:///tmp/file"
    path = Path(".") / "file"
    assert path_to_url("file") == "file://" + path.absolute().as_posix()