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

Function test_history_class_get

tests/test_history.py:282–292  ·  view source on GitHub ↗
(hist)

Source from the content-addressed store, hash-verified

280
281
282def test_history_class_get(hist) -> None:
283 assert hist.get(1).statement.raw == "first"
284 assert hist.get(3).statement.raw == "third"
285 assert hist.get(-2) == hist[-2]
286 assert hist.get(-1).statement.raw == "fourth"
287
288 with pytest.raises(IndexError):
289 hist.get(0)
290
291 with pytest.raises(IndexError):
292 hist.get(5)
293
294
295def test_history_str_search(hist) -> None:

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…