MCPcopy
hub / github.com/Fosowl/agenticSeek / test_clear_section

Method test_clear_section

tests/test_memory.py:60–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58 self.assertEqual(len(self.memory.memory), 1) # doesn't clear sys message
59
60 def test_clear_section(self):
61 self.memory.clear()
62 mem_begin_idx = self.memory.push("user", "Hi i want you to make...")
63 self.memory.push("assistant", "<code>")
64 self.memory.push("user", "sys feedback: error")
65 self.memory.push("assistant", "<corrected code>")
66 mem_end_idx = self.memory.push("user", "according to search...")
67 self.memory.clear_section(mem_begin_idx+1, mem_end_idx-1)
68 self.assertEqual(len(self.memory.memory), 3) # 3 msg with sys msg
69 self.assertEqual(self.memory.memory[0]['role'], "system")
70
71 def test_get(self):
72 self.memory.push("user", "Hello")

Callers

nothing calls this directly

Calls 3

clearMethod · 0.80
pushMethod · 0.80
clear_sectionMethod · 0.80

Tested by

no test coverage detected