Skip to content

Commit

Permalink
test: update sdk version and cases (#38363)
Browse files Browse the repository at this point in the history
pr: #38330

Signed-off-by: nico <[email protected]>
  • Loading branch information
NicoYuan1986 authored Dec 12, 2024
1 parent d7e926f commit 2e5537f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def test_milvus_client_delete_with_invalid_id_type(self):
"err_msg": "expr cannot be empty"})

@pytest.mark.tags(CaseLabel.L1)
@pytest.mark.xfail(reason="pymilvus issue 1870")
def test_milvus_client_delete_with_not_all_required_params(self):
"""
target: test delete (high level api)
Expand All @@ -121,8 +120,8 @@ def test_milvus_client_delete_with_not_all_required_params(self):
# 2. delete
client_w.delete(client, collection_name,
check_task=CheckTasks.err_res,
check_items={"err_code": 1,
"err_msg": "expr cannot be empty"})
check_items={"err_code": 999,
"err_msg": "The type of expr must be string ,but <class 'NoneType'> is given."})


class TestMilvusClientDeleteValid(TestcaseBase):
Expand Down
10 changes: 6 additions & 4 deletions tests/python_client/testcases/test_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_delete_expr_none(self):
"""
# init collection with tmp_nb default data
collection_w = self.init_collection_general(prefix, nb=tmp_nb, insert_data=True)[0]
error = {ct.err_code: 1, ct.err_msg: "expr cannot be None"}
error = {ct.err_code: 999, ct.err_msg: "Illegal str variables: {'filter': None}, expect non-empty str"}
collection_w.delete(expr=None, check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L2)
Expand All @@ -121,7 +121,8 @@ def test_delete_expr_non_string(self, expr):
"""
# init collection with tmp_nb default data
collection_w = self.init_collection_general(prefix, nb=tmp_nb, insert_data=True)[0]
error = {ct.err_code: 1, ct.err_msg: f"expr value {expr} is illegal"}
error = {ct.err_code: 999, ct.err_msg: "Illegal str variables: {'filter': %s}, expect non-empty str"
% str(expr)}
collection_w.delete(expr, check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L2)
Expand Down Expand Up @@ -312,7 +313,8 @@ def test_delete_non_string_partition_name(self, partition_name):
collection_w = self.init_collection_general(prefix, nb=tmp_nb, insert_data=True)[0]

error = {ct.err_code: 0,
ct.err_msg: f"partition_name value {partition_name} is illegal"}
ct.err_msg: "Illegal nullable str variables: {'partition_name': %s}, "
"expect None or non-empty str" % str(partition_name)}
collection_w.delete(tmp_expr, partition_name=partition_name,
check_task=CheckTasks.err_res, check_items=error)

Expand Down Expand Up @@ -2069,7 +2071,7 @@ def test_delete_expr_empty_string(self):
collection_w = self.init_collection_general(prefix, True)[0]

# delete
error = {ct.err_code: 1, ct.err_msg: "expr cannot be empty"}
error = {ct.err_code: 1, ct.err_msg: "Illegal str variables: {'filter': ''}, expect non-empty str"}
collection_w.delete(expr="", check_task=CheckTasks.err_res, check_items=error)

@pytest.mark.tags(CaseLabel.L2)
Expand Down
2 changes: 1 addition & 1 deletion tests/python_client/testcases/test_partition_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def test_partition_key_insert_invalid_data(self, invalid_data):
float_vec_values = gen_vectors(nb, ct.default_dim)
data = [pk_values, int64_values, string_values, float_vec_values]

err_msg = "expect string input"
err_msg = "field (varchar) expect string input"
collection_w.insert(data, check_task=CheckTasks.err_res, check_items={"err_code": 2, "err_msg": err_msg})


Expand Down

0 comments on commit 2e5537f

Please sign in to comment.