Code Duplication    Length = 20-21 lines in 3 locations

tests/milvus_python_test/test_index.py 3 locations

@@ 1663-1683 (lines=21) @@
1660
    ******************************************************************
1661
    """
1662
1663
    def test_drop_index(self, connect, ham_collection, get_hamming_index):
1664
        '''
1665
        target: test drop index interface
1666
        method: create collection and add vectors in it, create index, call drop index
1667
        expected: return code 0, and default index param
1668
        '''
1669
        index_param = get_hamming_index["index_param"]
1670
        index_type = get_hamming_index["index_type"]
1671
        status, mode = connect._cmd("mode")
1672
        assert status.OK()
1673
        # status, ids = connect.insert(ip_collection, vectors)
1674
        status = connect.create_index(ham_collection, index_type, index_param)
1675
        assert status.OK()
1676
        status, result = connect.get_index_info(ham_collection)
1677
        logging.getLogger().info(result)
1678
        status = connect.drop_index(ham_collection)
1679
        assert status.OK()
1680
        status, result = connect.get_index_info(ham_collection)
1681
        logging.getLogger().info(result)
1682
        assert result._collection_name == ham_collection
1683
        assert result._index_type == IndexType.FLAT
1684
1685
    def test_drop_index_substructure(self, connect, substructure_collection, get_substructure_index):
1686
        '''
@@ 1384-1404 (lines=21) @@
1381
    ******************************************************************
1382
    """
1383
1384
    def test_drop_index(self, connect, jac_collection, get_jaccard_index):
1385
        '''
1386
        target: test drop index interface
1387
        method: create collection and add vectors in it, create index, call drop index
1388
        expected: return code 0, and default index param
1389
        '''
1390
        index_param = get_jaccard_index["index_param"]
1391
        index_type = get_jaccard_index["index_type"]
1392
        status, mode = connect._cmd("mode")
1393
        assert status.OK()
1394
        # status, ids = connect.insert(ip_collection, vectors)
1395
        status = connect.create_index(jac_collection, index_type, index_param)
1396
        assert status.OK()
1397
        status, result = connect.get_index_info(jac_collection)
1398
        logging.getLogger().info(result)
1399
        status = connect.drop_index(jac_collection)
1400
        assert status.OK()
1401
        status, result = connect.get_index_info(jac_collection)
1402
        logging.getLogger().info(result)
1403
        assert result._collection_name == jac_collection
1404
        assert result._index_type == IndexType.FLAT
1405
1406
    def test_drop_index_partition(self, connect, jac_collection, get_jaccard_index):
1407
        '''
@@ 1685-1704 (lines=20) @@
1682
        assert result._collection_name == ham_collection
1683
        assert result._index_type == IndexType.FLAT
1684
1685
    def test_drop_index_substructure(self, connect, substructure_collection, get_substructure_index):
1686
        '''
1687
        target: test drop index interface
1688
        method: create collection and add vectors in it, create index, call drop index
1689
        expected: return code 0, and default index param
1690
        '''
1691
        index_param = get_substructure_index["index_param"]
1692
        index_type = get_substructure_index["index_type"]
1693
        status, mode = connect._cmd("mode")
1694
        assert status.OK()
1695
        status = connect.create_index(substructure_collection, index_type, index_param)
1696
        assert status.OK()
1697
        status, result = connect.get_index_info(substructure_collection)
1698
        logging.getLogger().info(result)
1699
        status = connect.drop_index(substructure_collection)
1700
        assert status.OK()
1701
        status, result = connect.get_index_info(substructure_collection)
1702
        logging.getLogger().info(result)
1703
        assert result._collection_name == substructure_collection
1704
        assert result._index_type == IndexType.FLAT
1705
1706
    def test_drop_index_partition(self, connect, ham_collection, get_hamming_index):
1707
        '''