Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander.A,Utkin committed Feb 19, 2025
1 parent 4ce03b4 commit b13b5f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyreindexer/tests/tests/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_cannot_delete_not_existing_index_in_namespace(self, db, namespace):
# Then ("Check that we can't delete index that was not created")
index_name = 'id'
assert_that(calling(db.index.drop).with_args(namespace, index_name),
raises(ApiError, pattern=f"Cannot remove index {index_name}: doesn't exist"),
raises(ApiError, pattern=f"Cannot remove index '{index_name}': doesn't exist"),
"Not existing index was deleted")

def test_index_update_timeout(self, db, namespace):
Expand Down
10 changes: 10 additions & 0 deletions pyreindexer/tests/tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,26 +842,36 @@ def test_query_knn_param_negative(self, db, namespace):
IndexSearchParamBruteForce(0)
except ValueError as e:
assert_that(str(e), equal_to("KNN limit 'k' should not be less than 1"))
else:
assert_that('', equal_to("KNN limit 'k' should not be less than 1"))

try:
IndexSearchParamHnsw(0, 1)
except ValueError as e:
assert_that(str(e), equal_to("KNN limit 'k' should not be less than 1"))
else:
assert_that('', equal_to("KNN limit 'k' should not be less than 1"))

try:
IndexSearchParamHnsw(2, 1)
except ValueError as e:
assert_that(str(e), equal_to("'ef' should not be less than 'k'"))
else:
assert_that('', equal_to("'ef' should not be less than 'k'"))

try:
IndexSearchParamIvf(0, 1)
except ValueError as e:
assert_that(str(e), equal_to("KNN limit 'k' should not be less than 1"))
else:
assert_that('', equal_to("KNN limit 'k' should not be less than 1"))

try:
IndexSearchParamIvf(1, 0)
except ValueError as e:
assert_that(str(e), equal_to("'nprobe' should not be less than 1"))
else:
assert_that('', equal_to("'nprobe' should not be less than 1"))

# When ("Make query with knn")
assert_that(calling(query.where_knn).with_args("vec", None, None),
Expand Down

0 comments on commit b13b5f8

Please sign in to comment.