Coverage for tests/test_completion/test_completion_path.py: 100%
11 statements
« prev ^ index » next coverage.py v7.6.1, created at 2025-04-14 00:18 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2025-04-14 00:18 +0000
1import os 1abcdefghi
2import subprocess 1abcdefghi
3import sys 1abcdefghi
5from . import path_example as mod 1abcdefghi
8def test_script(): 1abcdefghi
9 result = subprocess.run( 1abcdefghi
10 [sys.executable, "-m", "coverage", "run", mod.__file__, "path/to/deadpool"],
11 capture_output=True,
12 encoding="utf-8",
13 )
14 assert result.returncode == 0 1abcdefghi
15 assert "deadpool" in result.stdout 1abcdefghi
18def test_completion_path_bash(): 1abcdefghi
19 result = subprocess.run( 1abcdefghi
20 [sys.executable, "-m", "coverage", "run", mod.__file__, " "],
21 capture_output=True,
22 encoding="utf-8",
23 env={
24 **os.environ,
25 "_PATH_EXAMPLE.PY_COMPLETE": "complete_bash",
26 "COMP_WORDS": "path_example.py ",
27 "COMP_CWORD": "2",
28 },
29 )
30 assert result.returncode == 0 1abcdefghi