Skip to content

armgit / mem0

Public Imported from GitHub
0

The Memory Layer for AI Agents - Drop-in memory infrastructure for AI agents and apps. Context that persists. Built for production.

Fix Qdrant Tests (#2287)

Dev Khanta4340b2336ae
diff --git a/tests/vector_stores/test_qdrant.py b/tests/vector_stores/test_qdrant.py
index ce5cc5b11..cf6e63a52 100644
--- a/tests/vector_stores/test_qdrant.py
+++ b/tests/vector_stores/test_qdrant.py
@@ -51,7 +51,8 @@ class TestQdrant(unittest.TestCase):
def test_search(self):
query_vector = [0.1, 0.2]
- self.client_mock.search.return_value = [{"id": str(uuid.uuid4()), "score": 0.95, "payload": {"key": "value"}}]
+ mock_point = MagicMock(id=str(uuid.uuid4()), score=0.95, payload={"key": "value"})
+ self.client_mock.query_points.return_value = MagicMock(points=[mock_point])
results = self.qdrant.search(query=query_vector, limit=1)
@@ -63,9 +64,8 @@ class TestQdrant(unittest.TestCase):
)
self.assertEqual(len(results), 1)
- self.assertIn("id", results[0])
- self.assertIn("score", results[0])
- self.assertIn("payload", results[0])
+ self.assertEqual(results[0].payload, {"key": "value"})
+ self.assertEqual(results[0].score, 0.95)
def test_delete(self):
vector_id = str(uuid.uuid4())