Add test cases of index (#20093)

Signed-off-by: nico <cheng.yuan@zilliz.com>

Signed-off-by: nico <cheng.yuan@zilliz.com>
This commit is contained in:
NicoYuan1986 2022-10-26 17:45:33 +08:00 committed by GitHub
parent 00a0f7b643
commit 346b2ac2f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -227,6 +227,19 @@ class TestIndexOperation(TestcaseBase):
collection_w.create_index(default_field_name, default_index)
collection_w.create_index(ct.default_int64_field_name, {})
@pytest.mark.tags(CaseLabel.L1)
def test_index_create_on_scalar_field(self):
"""
target: Test create index on scalar field
method: create index on scalar field and load
expected: raise exception
"""
collection_w = self.init_collection_general(prefix, True, is_index=True)[0]
collection_w.create_index(ct.default_int64_field_name, {})
collection_w.load(check_task=CheckTasks.err_res,
check_items={ct.err_code: 1, ct.err_msg: "there is no vector index on collection, "
"please create index firstly"})
@pytest.mark.tags(CaseLabel.L1)
def test_index_collection_empty(self):
"""