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

Function test_autcomp_flag_completion

tests/test_argparse_completer.py:567–576  ·  view source on GitHub ↗
(ac_app, command_and_args, text, expected_data)

Source from the content-addressed store, hash-verified

565 ],
566)
567def test_autcomp_flag_completion(ac_app, command_and_args, text, expected_data) -> None:
568 line = f"{command_and_args} {text}"
569 endidx = len(line)
570 begidx = endidx - len(text)
571
572 expected_completions = Completions(items=[CompletionItem(value=v, display=d) for v, d in expected_data])
573 completions = ac_app.complete(text, line, begidx, endidx)
574
575 assert completions.to_strings() == expected_completions.to_strings()
576 assert [item.display for item in completions] == [item.display for item in expected_completions]
577
578
579@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 4

CompletionsClass · 0.90
CompletionItemClass · 0.90
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…