From 9ea4c509c7174628143b01778a374573efac561d Mon Sep 17 00:00:00 2001 From: NicoYuan1986 <109071306+NicoYuan1986@users.noreply.github.com> Date: Sat, 18 Feb 2023 09:40:28 +0800 Subject: [PATCH] Modify test case about replica number (#22251) Signed-off-by: nico --- tests/python_client/testcases/test_collection.py | 4 ++-- tests/python_client/testcases/test_partition.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/python_client/testcases/test_collection.py b/tests/python_client/testcases/test_collection.py index 6bdf024e99..09e411704a 100644 --- a/tests/python_client/testcases/test_collection.py +++ b/tests/python_client/testcases/test_collection.py @@ -2228,11 +2228,11 @@ class TestLoadCollection(TestcaseBase): collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index) # load with non-number replicas - error = {ct.err_code: 0, ct.err_msg: f"but expected one of: int, long"} + error = {ct.err_code: 1, ct.err_msg: f"but expected one of: int, long"} collection_w.load(replica_number=get_non_number_replicas, check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L2) - @pytest.mark.parametrize("replicas", [-1, 0, None]) + @pytest.mark.parametrize("replicas", [-1, 0]) def test_load_replica_invalid_number(self, replicas): """ target: test load partition with invalid replica number diff --git a/tests/python_client/testcases/test_partition.py b/tests/python_client/testcases/test_partition.py index 09c0ff95f6..da87712f4c 100644 --- a/tests/python_client/testcases/test_partition.py +++ b/tests/python_client/testcases/test_partition.py @@ -329,17 +329,17 @@ class TestPartitionParams(TestcaseBase): partition_w.insert(cf.gen_default_list_data(nb=100)) # load with non-number replicas - error = {ct.err_code: 0, ct.err_msg: f"but expected one of: int, long"} + error = {ct.err_code: 1, ct.err_msg: f"but expected one of: int, long"} collection_w.create_index(ct.default_float_vec_field_name, index_params=ct.default_flat_index) partition_w.load(replica_number=get_non_number_replicas, check_task=CheckTasks.err_res, check_items=error) @pytest.mark.tags(CaseLabel.L2) - @pytest.mark.parametrize("replicas", [0, -1, None]) + @pytest.mark.parametrize("replicas", [0, -1]) def test_load_replica_invalid_number(self, replicas): """ target: test load partition with invalid replica number method: load with invalid replica number - expected: raise exception + expected: load successfully as replica = 1 """ # create, insert self._connect()