(base_app, request)
| 257 | |
| 258 | |
| 259 | def test_complete_macro(base_app, request) -> None: |
| 260 | # Create the macro |
| 261 | out, _err = run_cmd(base_app, "macro create fake run_pyscript {1}") |
| 262 | assert out == normalize("Macro 'fake' created") |
| 263 | |
| 264 | # Macros do path completion |
| 265 | test_dir = os.path.dirname(request.module.__file__) |
| 266 | |
| 267 | text = os.path.join(test_dir, "s") |
| 268 | line = f"fake {text}" |
| 269 | |
| 270 | endidx = len(line) |
| 271 | begidx = endidx - len(text) |
| 272 | |
| 273 | expected = [text + "cript.py", text + "cript.txt", text + "cripts" + os.path.sep] |
| 274 | completions = base_app.complete(text, line, begidx, endidx) |
| 275 | assert completions.to_strings() == Completions.from_values(expected).to_strings() |
| 276 | |
| 277 | |
| 278 | def test_default_str_sort_key(cmd2_app) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…