MCPcopy Create free account
hub / github.com/MinishLab/vicinity / test_vicinity_delete_with_store

Function test_vicinity_delete_with_store

tests/test_vicinity.py:243–255  ·  view source on GitHub ↗

Test Vicinity.delete method by verifying that the vector for a deleted item is not returned in subsequent queries. :param vicinity_with_basic_backend_and_store: A Vicinity instance.

(vicinity_with_basic_backend_and_store: Vicinity)

Source from the content-addressed store, hash-verified

241
242
243def test_vicinity_delete_with_store(vicinity_with_basic_backend_and_store: Vicinity) -> None:
244 """
245 Test Vicinity.delete method by verifying that the vector for a deleted item is not returned in subsequent queries.
246
247 :param vicinity_with_basic_backend_and_store: A Vicinity instance.
248 """
249 assert vicinity_with_basic_backend_and_store.vector_store is not None
250 # Delete "item2" from the Vicinity instance
251 vicinity_with_basic_backend_and_store.delete(["item2"])
252
253 # Ensure "item2" is no longer in the items list
254 assert "item2" not in vicinity_with_basic_backend_and_store.items
255 assert len(vicinity_with_basic_backend_and_store) == len(vicinity_with_basic_backend_and_store.vector_store)
256
257
258def test_vicinity_insert_mismatched_lengths(vicinity_instance: Vicinity, query_vector: np.ndarray) -> None:

Callers

nothing calls this directly

Calls 1

deleteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…