MCPcopy Create free account
hub / github.com/bpython/bpython / test_save

Method test_save

bpython/test/test_history.py:112–124  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

110 self.assertEqual(history.entries, ["#1", "#2", "#3", "#4"])
111
112 def test_save(self):
113 history = History()
114 for line in ("#1", "#2", "#3", "#4"):
115 history.append_to(history.entries, line)
116
117 # save only last 2 lines
118 history.save(self.filename, self.encoding, lines=2)
119
120 # load again from the file
121 history = History()
122 history.load(self.filename, self.encoding)
123
124 self.assertEqual(history.entries, ["#3", "#4"])
125
126 def tearDown(self):
127 self.tempdir = None

Callers

nothing calls this directly

Calls 4

append_toMethod · 0.95
saveMethod · 0.95
loadMethod · 0.95
HistoryClass · 0.90

Tested by

no test coverage detected