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

Function test_vicinity_insert_with_store

tests/test_vicinity.py:229–240  ·  view source on GitHub ↗

Test that Vicinity.insert raises ValueError when trying to insert vectors into a Vicinity instance with stored vectors. :param vicinity_with_basic_backend_and_store: A Vicinity instance with stored vectors.

(vicinity_with_basic_backend_and_store: Vicinity)

Source from the content-addressed store, hash-verified

227
228
229def test_vicinity_insert_with_store(vicinity_with_basic_backend_and_store: Vicinity) -> None:
230 """
231 Test that Vicinity.insert raises ValueError when trying to insert vectors into a Vicinity instance with stored vectors.
232
233 :param vicinity_with_basic_backend_and_store: A Vicinity instance with stored vectors.
234 """
235 new_item = ["item10002"]
236 new_vector = np.full((1, vicinity_with_basic_backend_and_store.dim), 0.5)
237
238 vicinity_with_basic_backend_and_store.insert(new_item, new_vector)
239 assert vicinity_with_basic_backend_and_store.vector_store is not None
240 assert len(vicinity_with_basic_backend_and_store) == len(vicinity_with_basic_backend_and_store.vector_store)
241
242
243def test_vicinity_delete_with_store(vicinity_with_basic_backend_and_store: Vicinity) -> None:

Callers

nothing calls this directly

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…