MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / test_note_persistence

Function test_note_persistence

tests/test_note_tool.py:87–113  ·  view source on GitHub ↗

Test that notes persist across tool instances.

()

Source from the content-addressed store, hash-verified

85
86@pytest.mark.asyncio
87async def test_note_persistence():
88 """Test that notes persist across tool instances."""
89 print("\n=== Testing Note Persistence ===")
90
91 with tempfile.NamedTemporaryFile(mode="w", delete=False, suffix=".json") as f:
92 note_file = f.name
93
94 try:
95 # First instance - record note
96 record_tool1 = SessionNoteTool(memory_file=note_file)
97 result = await record_tool1.execute(
98 content="Important fact to remember",
99 category="test",
100 )
101 assert result.success
102
103 # Second instance - recall note (simulates new session)
104 recall_tool2 = RecallNoteTool(memory_file=note_file)
105 result = await recall_tool2.execute()
106 assert result.success
107 assert "Important fact to remember" in result.content
108 print(f"Persisted note: {result.content}")
109
110 print("✅ Note persistence test passed")
111
112 finally:
113 Path(note_file).unlink(missing_ok=True)
114
115
116async def main():

Callers 1

mainFunction · 0.85

Calls 4

executeMethod · 0.95
executeMethod · 0.95
SessionNoteToolClass · 0.90
RecallNoteToolClass · 0.90

Tested by

no test coverage detected