MCPcopy Create free account
hub / github.com/python-cmd2/cmd2 / test_get_macro_choices

Function test_get_macro_choices

tests/test_cmd2.py:2686–2698  ·  view source on GitHub ↗
(base_app: cmd2.Cmd)

Source from the content-addressed store, hash-verified

2684
2685
2686def test_get_macro_choices(base_app: cmd2.Cmd) -> None:
2687 run_cmd(base_app, "macro create foo !echo foo")
2688 run_cmd(base_app, "macro create bar !echo bar")
2689
2690 choices = base_app._get_macro_choices()
2691
2692 macros = base_app.macros
2693 assert len(choices) == len(macros)
2694
2695 for cur_choice in choices:
2696 assert cur_choice.text in macros
2697 assert cur_choice.display_meta == macros[cur_choice.text].value
2698 assert cur_choice.table_data == (macros[cur_choice.text].value,)
2699
2700
2701def test_get_commands_aliases_and_macros_choices(base_app: cmd2.Cmd) -> None:

Callers

nothing calls this directly

Calls 2

run_cmdFunction · 0.85
_get_macro_choicesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…