MCPcopy Create free account
hub / github.com/Exorust/Adkit-MCP / FakeVectorStore

Class FakeVectorStore

tests/test_match_service.py:67–88  ·  view source on GitHub ↗

Returns canned hits; records calls for assertions.

Source from the content-addressed store, hash-verified

65
66
67class FakeVectorStore:
68 """Returns canned hits; records calls for assertions."""
69
70 def __init__(self, hits: list[VectorHit] | None = None):
71 self.hits = hits if hits is not None else list(SAMPLE_HITS)
72 self.last_query_args: dict | None = None
73
74 def query(self, vector, vector_filter, top_k):
75 self.last_query_args = {
76 "vector": vector,
77 "vector_filter": vector_filter,
78 "top_k": top_k,
79 }
80 return self.hits[:top_k]
81
82 # Stubs for VectorStorePort mutations (not exercised in match tests)
83 def ensure_collection(self, dimension): ...
84 def delete_collection(self): ...
85 def collection_info(self): ...
86 def upsert_batch(self, ads_with_embeddings): ...
87 def delete_ad(self, ad_id): ...
88 def get_ad(self, ad_id): ...
89
90
91# ---------------------------------------------------------------------------

Callers 1

_build_serviceFunction · 0.85

Calls

no outgoing calls

Tested by 1

_build_serviceFunction · 0.68