Skip to content

Commit b9a3e54

Browse files
JerrettDavisCopilot
andcommitted
test: update memory embedder doubles
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2559251 commit b9a3e54

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

tests/test_memory_embedders.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ def enable_padding(self, length):
142142
def encode(self, text):
143143
return SimpleNamespace(ids=[1, 2], attention_mask=[1, 1])
144144

145+
def encode_batch(self, texts):
146+
return [self.encode(text) for text in texts]
147+
145148
monkeypatch.setitem(
146149
sys.modules,
147150
"onnxruntime",

tests/test_memory_mcp_server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ async def test_warm_up_backend_indexes_memories() -> None:
7272
backend = SimpleNamespace(
7373
_ensure_initialized=AsyncMock(),
7474
_hierarchical_memory=SimpleNamespace(
75-
_embedder=SimpleNamespace(embed=AsyncMock(side_effect=[["warm"], ["first-embedding"]])),
75+
_embedder=SimpleNamespace(
76+
embed=AsyncMock(side_effect=[["warm"], ["first-embedding"]]),
77+
embed_batch=AsyncMock(return_value=[["first-embedding"], [9]]),
78+
),
7679
_store=SimpleNamespace(save=AsyncMock()),
7780
_vector_index=SimpleNamespace(index=AsyncMock()),
7881
),

0 commit comments

Comments
 (0)