Code Duplication    Length = 13-14 lines in 3 locations

tests/milvus_python_test/entity/test_insert.py 3 locations

@@ 242-255 (lines=14) @@
239
            param['collection_name'], index_type, index_param)
240
        assert status.OK()
241
242
    @pytest.mark.timeout(ADD_TIMEOUT)
243
    def test_add_vector_sleep_create_index(self, connect, collection, get_simple_index):
244
        '''
245
        target: test build index add after vector for a while
246
        method: add vector and build index
247
        expected: status ok
248
        '''
249
        index_param = get_simple_index["index_param"]
250
        index_type = get_simple_index["index_type"]
251
        vector = gen_single_vector(dim)
252
        status, ids = connect.insert(collection, vector)
253
        connect.flush([collection])
254
        status = connect.create_index(collection, index_type, index_param)
255
        assert status.OK()
256
257
    @pytest.mark.timeout(ADD_TIMEOUT)
258
    def test_add_vector_sleep_create_index_another(self, connect, collection, get_simple_index):
@@ 927-939 (lines=13) @@
924
        status = connect.drop_collection(param['collection_name'])
925
        assert status.OK()
926
927
    @pytest.mark.timeout(ADD_TIMEOUT)
928
    def test_create_index_add_vector(self, connect, ip_collection, get_simple_index):
929
        '''
930
        target: test add vector after build index
931
        method: build index and add vector
932
        expected: status ok
933
        '''
934
        index_param = get_simple_index["index_param"]
935
        index_type = get_simple_index["index_type"]
936
        status = connect.create_index(ip_collection, index_type, index_param)
937
        vector = gen_single_vector(dim)
938
        status, ids = connect.insert(ip_collection, vector)
939
        assert status.OK()
940
941
    @pytest.mark.timeout(ADD_TIMEOUT)
942
    def test_create_index_add_vector_another(self, connect, ip_collection, get_simple_index):
@@ 173-185 (lines=13) @@
170
        status = connect.drop_collection(param['collection_name'])
171
        assert status.OK()
172
173
    @pytest.mark.timeout(ADD_TIMEOUT)
174
    def test_create_index_add_vector(self, connect, collection, get_simple_index):
175
        '''
176
        target: test add vector after build index
177
        method: build index and add vector
178
        expected: status ok
179
        '''
180
        index_param = get_simple_index["index_param"]
181
        index_type = get_simple_index["index_type"]
182
        status = connect.create_index(collection, index_type, index_param)
183
        vector = gen_single_vector(dim)
184
        status, ids = connect.insert(collection, vector)
185
        assert status.OK()
186
187
    @pytest.mark.timeout(ADD_TIMEOUT)
188
    def test_create_index_add_vector_another(self, connect, collection, get_simple_index):