()
| 1290 | |
| 1291 | |
| 1292 | def 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 | |
| 1307 | class HelpApp(cmd2.Cmd): |
nothing calls this directly
no test coverage detected
searching dependent graphs…