Skip to content

Commit

Permalink
chore: Added test case
Browse files Browse the repository at this point in the history
  • Loading branch information
hh-space-invader committed Oct 17, 2024
1 parent 728ce36 commit cdc374c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/congruence_tests/test_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,24 @@ def test_upload_wrong_vectors():
wrong_vectors_collection,
points=[models.PointStruct(id=1, vector=unnamed_vector)],
)


def test_upsert_without_vector_name():
local_client = init_local()
remote_client = init_remote()

local_client.create_collection(collection_name=COLLECTION_NAME, vectors_config={})
if remote_client.collection_exists(collection_name=COLLECTION_NAME):
remote_client.delete_collection(collection_name=COLLECTION_NAME)
remote_client.create_collection(collection_name=COLLECTION_NAME, vectors_config={})

with pytest.raises(ValueError, match="Not existing vector name error"):
local_client.upsert(
COLLECTION_NAME, points=[models.PointStruct(id=1, vector=[0.1, 0.2, 0.3])]
)
with pytest.raises(
qdrant_client.http.exceptions.UnexpectedResponse, match="Not existing vector name error"
):
remote_client.upsert(
COLLECTION_NAME, points=[models.PointStruct(id=1, vector=[0.1, 0.2, 0.3])]
)

0 comments on commit cdc374c

Please sign in to comment.