""" Tests for LongTermMemory. """ import pytest from dcos.memory.long_term import LongTermMemory, Importance class TestLongTermMemory: def test_commit_and_recall(self): mem = LongTermMemory() mem.commit("important_fact", "AI is valuable", Importance.HIGH) assert mem.recall("important_fact") == "AI is valuable" def test_recall_missing(self): mem = LongTermMemory() assert mem.recall("nonexistent") is None def test_consolidate(self): mem = LongTermMemory() count = mem.consolidate({"temp": "data"}) assert count == 1 assert mem.recall("temp") == "data" def test_search(self): mem = LongTermMemory() mem.commit("python_info", "Python is a language", Importance.MEDIUM) mem.commit("java_info", "Java is a language", Importance.MEDIUM) results = mem.search("python") assert len(results) > 0