Skip to content

Commit 9be1eed

Browse files
committed
test(sshfs): create files on the fly to work around Windows filesystem
scop#1397 (comment)
1 parent 4bd8b58 commit 9be1eed

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

test/t/test_sshfs.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
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

6-
@pytest.mark.bashcomp(ignore_env=r"^[+-]_comp_cmd_scp__path_esc=")
8+
@pytest.mark.bashcomp(
9+
ignore_env=r"^[+-]_comp_cmd_scp__path_esc=", temp_cwd=True
10+
)
711
class TestSshfs:
812
@pytest.mark.complete("sshfs ./")
913
def test_1(self, completion):
1014
assert completion
1115

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

1633
def test_remote_path_ending_with_backslash(self, bash):

0 commit comments

Comments
 (0)