MCPcopy Create free account
hub / github.com/MemTensor/MemOS / test_search

Function test_search

tests/vec_dbs/test_qdrant.py:71–95  ·  view source on GitHub ↗
(vec_db)

Source from the content-addressed store, hash-verified

69
70
71def test_search(vec_db):
72 id = str(uuid.uuid4())
73 mock_response = type(
74 "QueryResponse",
75 (object,),
76 {
77 "points": [
78 type(
79 "obj",
80 (object,),
81 {
82 "id": id,
83 "vector": [0.1, 0.2, 0.3],
84 "payload": {"tag": "search"},
85 "score": 0.9,
86 },
87 )
88 ]
89 },
90 )()
91 vec_db.client.query_points.return_value = mock_response
92 results = vec_db.search([0.1, 0.2, 0.3], top_k=1)
93 assert len(results) == 1
94 assert isinstance(results[0], VecDBItem)
95 assert results[0].score == 0.9
96
97
98def test_update_vector(vec_db):

Callers

nothing calls this directly

Calls 1

searchMethod · 0.65

Tested by

no test coverage detected