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

Function persisted_hist

tests/test_history.py:136–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134
135@pytest.fixture
136def persisted_hist():
137 from cmd2.cmd2 import (
138 History,
139 HistoryItem,
140 )
141 from cmd2.parsing import (
142 Statement,
143 )
144
145 h = History(
146 [
147 HistoryItem(Statement("", raw="first")),
148 HistoryItem(Statement("", raw="second")),
149 HistoryItem(Statement("", raw="third")),
150 HistoryItem(Statement("", raw="fourth")),
151 ]
152 )
153 h.start_session()
154 h.append(Statement("", raw="fifth"))
155 h.append(Statement("", raw="sixth"))
156 return h
157
158
159def test_history_class_span(hist) -> None:

Callers

nothing calls this directly

Calls 5

start_sessionMethod · 0.95
appendMethod · 0.95
HistoryClass · 0.90
HistoryItemClass · 0.90
StatementClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…