MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_shell_command_complete

Function test_shell_command_complete

tests/test_completion.py:394–407  ·  view source on GitHub ↗
(cmd2_app)

Source from the content-addressed store, hash-verified

392
393
394def test_shell_command_complete(cmd2_app) -> None:
395 if sys.platform == "win32":
396 text = "c"
397 expected = "calc.exe"
398 else:
399 text = "l"
400 expected = "ls"
401
402 line = f"shell {text}"
403 endidx = len(line)
404 begidx = endidx - len(text)
405
406 completions = cmd2_app.complete(text, line, begidx, endidx)
407 assert expected in completions.to_strings()
408
409
410def test_shell_command_completion_nomatch(cmd2_app) -> None:

Callers

nothing calls this directly

Calls 2

to_stringsMethod · 0.80
completeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…