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

Function test_get_alias_choices

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

Source from the content-addressed store, hash-verified

2669
2670
2671def test_get_alias_choices(base_app: cmd2.Cmd) -> None:
2672 run_cmd(base_app, "alias create fake run_pyscript")
2673 run_cmd(base_app, "alias create ls !ls -hal")
2674
2675 choices = base_app._get_alias_choices()
2676
2677 aliases = base_app.aliases
2678 assert len(choices) == len(aliases)
2679
2680 for cur_choice in choices:
2681 assert cur_choice.text in aliases
2682 assert cur_choice.display_meta == aliases[cur_choice.text]
2683 assert cur_choice.table_data == (aliases[cur_choice.text],)
2684
2685
2686def test_get_macro_choices(base_app: cmd2.Cmd) -> None:

Callers

nothing calls this directly

Calls 2

run_cmdFunction · 0.85
_get_alias_choicesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…