From cdc374c014c3c2d5086510132559b770c4d9987f Mon Sep 17 00:00:00 2001 From: hh-space-invader Date: Thu, 17 Oct 2024 04:07:28 +0300 Subject: [PATCH] chore: Added test case --- tests/congruence_tests/test_updates.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/congruence_tests/test_updates.py b/tests/congruence_tests/test_updates.py index 1896eb1b..6319c485 100644 --- a/tests/congruence_tests/test_updates.py +++ b/tests/congruence_tests/test_updates.py @@ -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])] + )