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

Function test_visible_prompt

tests/test_cmd2.py:1292–1304  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1290
1291
1292def test_visible_prompt() -> None:
1293 app = cmd2.Cmd()
1294
1295 # This prompt has nothing which needs to be stripped
1296 app.prompt = "(Cmd) "
1297 assert app.visible_prompt == app.prompt
1298 assert su.str_width(app.prompt) == len(app.prompt)
1299
1300 # This prompt has color which needs to be stripped
1301 color_prompt = stylize("InColor", style=Color.CYAN) + "> "
1302 app.prompt = color_prompt
1303 assert app.visible_prompt == "InColor> "
1304 assert su.str_width(app.prompt) == len("InColor> ")
1305
1306
1307class HelpApp(cmd2.Cmd):

Callers

nothing calls this directly

Calls 1

stylizeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…