コード例 #1
0
def test_strip_protocol_expanduser():
    path = "file://~\\foo\\bar" if WIN else "file://~/foo/bar"
    stripped = LocalFileSystem._strip_protocol(path)
    assert path != stripped
    assert "file://" not in stripped
    assert stripped.startswith(os.path.expanduser("~").replace("\\", "/"))
    assert not LocalFileSystem._strip_protocol("./").endswith("/")
コード例 #2
0
def test_strip_protocol_expanduser():
    path = "file://~\\foo\\bar" if sys.platform == "win32" else "file://~/foo/bar"
    stripped = LocalFileSystem._strip_protocol(path)
    assert path != stripped
    assert "file://" not in stripped
    assert getpass.getuser() in stripped
コード例 #3
0
def test_strip_protocol_expanduser():
    path = "file://~\\foo\\bar" if sys.platform == "win32" else "file://~/foo/bar"
    stripped = LocalFileSystem._strip_protocol(path)
    assert path != stripped
    assert "file://" not in stripped
    assert stripped.startswith(os.path.expanduser("~").replace("\\", "/"))