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

Function test_shell_command_complete_in_path

tests/test_completion.py:444–458  ·  view source on GitHub ↗
(cmd2_app, request)

Source from the content-addressed store, hash-verified

442
443
444def test_shell_command_complete_in_path(cmd2_app, request) -> None:
445 test_dir = os.path.dirname(request.module.__file__)
446
447 text = os.path.join(test_dir, "s")
448 line = f"shell {text}"
449
450 endidx = len(line)
451 begidx = endidx - len(text)
452
453 # Since this will look for directories and executables in the given path,
454 # we expect to see the scripts dir among the results
455 expected = os.path.join(test_dir, "scripts" + os.path.sep)
456
457 completions = cmd2_app.complete(text, line, begidx, endidx)
458 assert expected in completions.to_strings()
459
460
461def test_path_completion_files_and_directories(cmd2_app, request) -> 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…