Skip to content

Commit 8c3b8ed

Browse files
committed
test(sshfs): create files on the fly to work around Windows filesystem
#1397 (comment)
1 parent ee6fa48 commit 8c3b8ed

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

test/fixtures/sshfs/local_path-dir/dummy.txt

Whitespace-only changes.

test/fixtures/sshfs/local_path-file\

Whitespace-only changes.

test/t/test_sshfs.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import sys
2+
13
import pytest
24

3-
from conftest import assert_bash_exec, assert_complete
5+
from conftest import assert_bash_exec, assert_complete, prepare_fixture_dir
46

57

68
@pytest.mark.bashcomp(ignore_env=r"^[+-]_comp_cmd_scp__path_esc=")
@@ -9,8 +11,21 @@ class TestSshfs:
911
def test_1(self, completion):
1012
assert completion
1113

12-
@pytest.mark.complete("sshfs local_path", cwd="sshfs")
13-
def test_local_path_suffix_1(self, completion):
14+
@pytest.fixture
15+
def tmpdir_backslash(self, request, bash):
16+
if sys.platform.startswith("win"):
17+
pytest.skip("Filenames not allowed on Windows")
18+
19+
tmpdir, _, _ = prepare_fixture_dir(
20+
request, files=["local_path-file\\"], dirs=["local_path-dir"]
21+
)
22+
return tmpdir
23+
24+
def test_local_path_suffix_1(self, bash, tmpdir_backslash):
25+
completion = assert_complete(
26+
bash, "sshfs local_path", cwd=tmpdir_backslash
27+
)
28+
1429
assert completion == "-dir/"
1530

1631
def test_remote_path_ending_with_backslash(self, bash):

0 commit comments

Comments
 (0)