(tmp_path)
| 44 | |
| 45 | |
| 46 | def 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 | |
| 60 | def test_save_load(tmp_path): |
nothing calls this directly
no test coverage detected