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)
| 227 | |
| 228 | |
| 229 | def 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 | |
| 243 | def test_vicinity_delete_with_store(vicinity_with_basic_backend_and_store: Vicinity) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…