From 346b2ac2f2f71143b68365af6897da3e337f3aea Mon Sep 17 00:00:00 2001 From: NicoYuan1986 <109071306+NicoYuan1986@users.noreply.github.com> Date: Wed, 26 Oct 2022 17:45:33 +0800 Subject: [PATCH] Add test cases of index (#20093) Signed-off-by: nico Signed-off-by: nico --- tests/python_client/testcases/test_index.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/python_client/testcases/test_index.py b/tests/python_client/testcases/test_index.py index e6459b854..22e178780 100644 --- a/tests/python_client/testcases/test_index.py +++ b/tests/python_client/testcases/test_index.py @@ -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): """ -- GitLab