From d2955bc8bad656d15e48f27fbc1f2c6b5dad0270 Mon Sep 17 00:00:00 2001 From: zhuwenxing Date: Wed, 10 Nov 2021 15:07:37 +0800 Subject: [PATCH] Add testcase for test index (#11545) Signed-off-by: zhuwenxing --- tests/python_client/testcases/test_index.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/python_client/testcases/test_index.py b/tests/python_client/testcases/test_index.py index 1f947d3310..53f25c4781 100644 --- a/tests/python_client/testcases/test_index.py +++ b/tests/python_client/testcases/test_index.py @@ -143,6 +143,21 @@ class TestIndexParams(TestcaseBase): class TestIndexOperation(TestcaseBase): """ Test case of index interface """ + @pytest.mark.tags(CaseLabel.L1) + def test_index_create_with_different_indexes(self): + """ + target: test create index on one field, with two different type of index + method: create two different indexes + expected: only latest index can be created for a collection + """ + c_name = cf.gen_unique_str(prefix) + collection_w = self.init_collection_wrap(name=c_name) + self.index_wrap.init_index(collection_w.collection, default_field_name, default_index_params) + self.index_wrap.init_index(collection_w.collection, default_field_name, default_index) + + assert len(collection_w.indexes) == 1 + assert collection_w.indexes[0].params["index_type"] == default_index["index_type"] + @pytest.mark.tags(CaseLabel.L1) def test_index_collection_empty(self): """