MCPcopy Create free account
hub / github.com/acgurl/mori / TestLongTermMemoryConfiguration

Class TestLongTermMemoryConfiguration

tests/test_long_term_memory.py:180–235  ·  view source on GitHub ↗

测试长期记忆配置的各种场景

Source from the content-addressed store, hash-verified

178
179
180class TestLongTermMemoryConfiguration:
181 """测试长期记忆配置的各种场景"""
182
183 def test_ltm_config_all_fields(self):
184 """测试长期记忆配置包含所有字段"""
185 ltm_config = {
186 "enabled": True,
187 "mode": "agent_control",
188 "user_name": "test_user",
189 "embedding_model": "text-embedding-v2",
190 "storage_path": "data/memory",
191 "on_disk": True,
192 }
193
194 assert ltm_config["enabled"] is True
195 assert ltm_config["mode"] == "agent_control"
196 assert ltm_config["user_name"] == "test_user"
197 assert ltm_config["embedding_model"] == "text-embedding-v2"
198 assert ltm_config["storage_path"] == "data/memory"
199 assert ltm_config["on_disk"] is True
200
201 def test_ltm_config_modes(self):
202 """测试长期记忆的不同模式"""
203 modes = ["agent_control", "static_control", "both"]
204
205 for mode in modes:
206 ltm_config = {
207 "enabled": True,
208 "mode": mode,
209 "user_name": "test_user",
210 "embedding_model": "text-embedding-v2",
211 }
212 assert ltm_config["mode"] == mode
213
214 def test_ltm_config_storage_options(self):
215 """测试长期记忆的存储选项"""
216 # 持久化存储
217 ltm_config_disk = {
218 "enabled": True,
219 "mode": "agent_control",
220 "user_name": "test_user",
221 "embedding_model": "text-embedding-v2",
222 "storage_path": "data/memory",
223 "on_disk": True,
224 }
225 assert ltm_config_disk["on_disk"] is True
226
227 # 内存存储
228 ltm_config_memory = {
229 "enabled": True,
230 "mode": "agent_control",
231 "user_name": "test_user",
232 "embedding_model": "text-embedding-v2",
233 "on_disk": False,
234 }
235 assert ltm_config_memory["on_disk"] is False
236
237

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected