Skip to content

Commit 1d4df44

Browse files
committed
test(python): add tests for script arguments
1 parent 128640e commit 1d4df44

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

test/fixtures/python/bar.txt

Whitespace-only changes.

test/fixtures/python/foo.py

Whitespace-only changes.

test/t/test_python.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,23 @@ def test_9(self, completion):
4545
)
4646
def test_bb(self, completion):
4747
assert "-bb" in completion
48+
49+
@pytest.mark.complete("python -m foo bar -p ", cwd="python")
50+
def test_script_args_1(self, completion):
51+
assert "bar.txt" in completion
52+
53+
@pytest.mark.complete("python -mfoo bar -p ", cwd="python")
54+
def test_script_args_2(self, completion):
55+
assert "bar.txt" in completion
56+
57+
@pytest.mark.complete("python -- foo ", cwd="python")
58+
def test_script_args_3(self, completion):
59+
assert "bar.txt" in completion
60+
61+
@pytest.mark.complete("python -- ", cwd="python")
62+
def test_script_args_4(self, completion):
63+
assert "bar.txt" not in completion
64+
65+
@pytest.mark.complete("python -W -mfoo ", cwd="python")
66+
def test_script_args_5(self, completion):
67+
assert "bar.txt" not in completion

0 commit comments

Comments
 (0)