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

Function test_cap_enforced

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

Source from the content-addressed store, hash-verified

44
45
46def test_cap_enforced(tmp_path):
47 _make_index(tmp_path, n=5)
48 mgr = EmbeddingIndexManager(
49 index_path=tmp_path / "seed_embeddings.npy",
50 labels_path=tmp_path / "seed_labels.json",
51 max_size=7,
52 )
53 for i in range(5):
54 vec = np.random.randn(384).astype(np.float32)
55 vec = vec / np.linalg.norm(vec)
56 mgr.add(vec, tier_id=i % 4)
57 assert mgr.size <= 7
58
59
60def test_save_load(tmp_path):

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
_make_indexFunction · 0.85

Tested by

no test coverage detected