diff --git a/tests/python_client/check/param_check.py b/tests/python_client/check/param_check.py index 428743a851c90de2b616592d5a60233eb4224da9..88ec72c78b7fd8ebbd789e58bce1267e6410f47a 100644 --- a/tests/python_client/check/param_check.py +++ b/tests/python_client/check/param_check.py @@ -209,6 +209,7 @@ def equal_entities_list(exp, actual, with_vec=False): actual = [{"int": 1, "vec": [0.888888, 0.222222]}, {"int": 0, "vec": [0.999999, 0.111111]}] exp = actual """ + exp = exp.copy() if len(exp) != len(actual): return False diff --git a/tests/python_client/testcases/test_delete.py b/tests/python_client/testcases/test_delete.py index 439a3ea80597f4f64f33a6a5a51bd765f2fe23f1..aa1963aad8915823a1b2903111a173c6ed10e9dd 100644 --- a/tests/python_client/testcases/test_delete.py +++ b/tests/python_client/testcases/test_delete.py @@ -149,10 +149,9 @@ class TestDeleteParams(TestcaseBase): collection_w.query(expr, check_task=CheckTasks.check_query_empty) @pytest.mark.tags(CaseLabel.L1) - @pytest.mark.parametrize("ids", [[tmp_nb], [0, tmp_nb]]) - def test_delete_not_existed_values(self, ids): + def test_delete_not_existed_values(self): """ - target: test delete part/not existed values + target: test delete not existed values method: delete data not in the collection expected: No exception """ @@ -160,12 +159,24 @@ class TestDeleteParams(TestcaseBase): collection_w = self.init_collection_general(prefix, nb=tmp_nb, insert_data=True)[0] # No exception - expr = f'{ct.default_int64_field_name} in {ids}' - res = collection_w.delete(expr=expr)[0] - # todo assert res.delete_count == 0 + expr = f'{ct.default_int64_field_name} in {[tmp_nb]}' + collection_w.delete(expr=expr)[0] collection_w.query(tmp_expr, check_task=CheckTasks.check_query_results, check_items={exp_res: query_res_tmp_expr}) + @pytest.mark.tags(CaseLabel.L2) + def test_delete_part_not_existed_values(self): + """ + target: test delete part non-existed values + method: delete ids which part not existed + expected: delete existed id, ignore non-existed id + """ + # init collection with tmp_nb default data + collection_w = self.init_collection_general(prefix, nb=tmp_nb, insert_data=True)[0] + expr = f'{ct.default_int64_field_name} in {[0, tmp_nb]}' + collection_w.delete(expr=expr)[0] + collection_w.query(expr, check_task=CheckTasks.check_query_empty) + @pytest.mark.tags(CaseLabel.L1) def test_delete_expr_inconsistent_values(self): """