MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / test_add_entry

Function test_add_entry

tests/test_index_growth.py:17–28  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

15
16
17def test_add_entry(tmp_path):
18 _make_index(tmp_path, n=5)
19 mgr = EmbeddingIndexManager(
20 index_path=tmp_path / "seed_embeddings.npy",
21 labels_path=tmp_path / "seed_labels.json",
22 max_size=100,
23 )
24 assert mgr.size == 5
25 new_vec = np.random.randn(384).astype(np.float32)
26 new_vec = new_vec / np.linalg.norm(new_vec)
27 mgr.add(new_vec, tier_id=2)
28 assert mgr.size == 6
29
30
31def test_dedup_rejects_near_duplicate(tmp_path):

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
_make_indexFunction · 0.85

Tested by

no test coverage detected