fix: remove numpy dependency from test_memory_embeddings
All checks were successful
Tests / lint (pull_request) Successful in 3s
Tests / test (pull_request) Successful in 1m8s

Use MagicMock to simulate .tolist() instead of importing numpy,
which is not in the test dependencies.

Fixes broken unit test on main.
This commit is contained in:
Timmy
2026-03-19 14:20:26 -04:00
parent 3590c1689e
commit 73614fb52d

View File

@@ -112,10 +112,10 @@ class TestEmbedText:
assert len(vec) == 128 # hash fallback dimension
def test_uses_model_when_available(self):
import numpy as np
mock_encoding = MagicMock()
mock_encoding.tolist.return_value = [0.1, 0.2, 0.3]
mock_model = MagicMock()
mock_model.encode.return_value = np.array([0.1, 0.2, 0.3])
mock_model.encode.return_value = mock_encoding
emb.EMBEDDING_MODEL = mock_model
result = embed_text("test")