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

Function test_add_alert

tests/test_cmd2.py:1278–1289  ·  view source on GitHub ↗
(base_app)

Source from the content-addressed store, hash-verified

1276
1277
1278def test_add_alert(base_app) -> None:
1279 orig_num_alerts = len(base_app._alert_queue)
1280
1281 # Nothing is added when both are None
1282 base_app.add_alert(msg=None, prompt=None)
1283 assert len(base_app._alert_queue) == orig_num_alerts
1284
1285 # Now test valid alert arguments
1286 base_app.add_alert(msg="Hello", prompt=None)
1287 base_app.add_alert(msg="Hello", prompt="prompt> ")
1288 base_app.add_alert(msg=None, prompt="prompt> ")
1289 assert len(base_app._alert_queue) == orig_num_alerts + 3
1290
1291
1292def test_visible_prompt() -> None:

Callers

nothing calls this directly

Calls 1

add_alertMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…