Add testcase for test index (#11545)

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
zhuwenxing 2021-11-10 15:07:37 +08:00 committed by GitHub
parent 5f08b67156
commit d2955bc8ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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):
"""