mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-14 07:18:27 +01:00
ssh: fix path normalization on Windows (#6517)
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ class SSHFileSystem(FSSpecWrapper):
|
||||
path_str = path.path
|
||||
else:
|
||||
path_str = super()._with_bucket(path)
|
||||
return os.path.normpath(path_str)
|
||||
return path_str
|
||||
|
||||
def _prepare_credentials(self, **config):
|
||||
self.CAN_TRAVERSE = True
|
||||
|
||||
@@ -178,3 +178,23 @@ def test_ssh_multi_identity_files(mock_file):
|
||||
def test_ssh_gss_auth(mock_file, config, expected_gss_auth):
|
||||
fs = SSHFileSystem(**config)
|
||||
assert fs.fs_args["gss_auth"] == expected_gss_auth
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"url, path",
|
||||
[
|
||||
("ssh://a@b/", "/"),
|
||||
("ssh://a@b:/", "/"),
|
||||
("ssh://a@b/home", "/home"),
|
||||
("ssh://a@b:/home", "/home"),
|
||||
("ssh://a@b/home/tmp", "/home/tmp"),
|
||||
("ssh://a@b:/home/tmp", "/home/tmp"),
|
||||
("ssh://a@b/home/tmp/something", "/home/tmp/something"),
|
||||
("ssh://a@b:/home/tmp/something", "/home/tmp/something"),
|
||||
],
|
||||
)
|
||||
def test_ssh_fs_path_management(url, path):
|
||||
fs = SSHFileSystem(host="x.y.z")
|
||||
|
||||
path_info = fs.PATH_CLS(url)
|
||||
assert fs._with_bucket(path_info) == path
|
||||
|
||||
Reference in New Issue
Block a user