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

Function test_vicinity_insert_duplicate

tests/test_vicinity.py:202–212  ·  view source on GitHub ↗

Test that Vicinity.insert raises ValueError when inserting duplicate items. :param vicinity_instance: A Vicinity instance. :raises ValueError: If inserting items that already exist.

(items: list[str], vicinity_instance: Vicinity, query_vector: np.ndarray)

Source from the content-addressed store, hash-verified

200
201
202def test_vicinity_insert_duplicate(items: list[str], vicinity_instance: Vicinity, query_vector: np.ndarray) -> None:
203 """
204 Test that Vicinity.insert raises ValueError when inserting duplicate items.
205
206 :param vicinity_instance: A Vicinity instance.
207 :raises ValueError: If inserting items that already exist.
208 """
209 new_vector = query_vector
210
211 with pytest.raises(ValueError):
212 vicinity_instance.insert(items[0], new_vector[None, :])
213
214
215def test_vicinity_delete_nonexistent(vicinity_instance: 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…