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

Function verify_hi_last_result

tests/test_history.py:20–27  ·  view source on GitHub ↗

Verifies app.last_result when it contains a dictionary of HistoryItems

(app: cmd2.Cmd, expected_length: int)

Source from the content-addressed store, hash-verified

18
19
20def verify_hi_last_result(app: cmd2.Cmd, expected_length: int) -> None:
21 """Verifies app.last_result when it contains a dictionary of HistoryItems"""
22 assert len(app.last_result) == expected_length
23
24 # Make sure last_result items match their respective indexes in the real history
25 for key in app.last_result:
26 # Keys in app.last_result are 1-based indexes into the app.history list
27 assert app.last_result[key] == app.history[key - 1]
28
29
30#

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…