|
@@ 1527-1542 (lines=16) @@
|
| 1524 |
|
status, res = connect.count_entities(ham_collection) |
| 1525 |
|
assert res == len(self.vectors) |
| 1526 |
|
|
| 1527 |
|
@pytest.mark.timeout(BUILD_TIMEOUT) |
| 1528 |
|
def test_create_index_partition_structure(self, connect, substructure_collection, get_substructure_index): |
| 1529 |
|
''' |
| 1530 |
|
target: test create index interface |
| 1531 |
|
method: create collection, create partition, and add vectors in it, create index |
| 1532 |
|
expected: return code equals to 0, and search success |
| 1533 |
|
''' |
| 1534 |
|
index_param = get_substructure_index["index_param"] |
| 1535 |
|
index_type = get_substructure_index["index_type"] |
| 1536 |
|
logging.getLogger().info(get_substructure_index) |
| 1537 |
|
status = connect.create_partition(substructure_collection, tag) |
| 1538 |
|
status, ids = connect.insert(substructure_collection, self.vectors, partition_tag=tag) |
| 1539 |
|
status = connect.create_index(substructure_collection, index_type, index_param) |
| 1540 |
|
assert status.OK() |
| 1541 |
|
status, res = connect.count_entities(substructure_collection,) |
| 1542 |
|
assert res == len(self.vectors) |
| 1543 |
|
|
| 1544 |
|
# @pytest.mark.level(2) |
| 1545 |
|
# def test_create_index_without_connect(self, dis_connect, ham_collection): |
|
@@ 1510-1525 (lines=16) @@
|
| 1507 |
|
else: |
| 1508 |
|
assert status.OK() |
| 1509 |
|
|
| 1510 |
|
@pytest.mark.timeout(BUILD_TIMEOUT) |
| 1511 |
|
def test_create_index_partition(self, connect, ham_collection, get_hamming_index): |
| 1512 |
|
''' |
| 1513 |
|
target: test create index interface |
| 1514 |
|
method: create collection, create partition, and add vectors in it, create index |
| 1515 |
|
expected: return code equals to 0, and search success |
| 1516 |
|
''' |
| 1517 |
|
index_param = get_hamming_index["index_param"] |
| 1518 |
|
index_type = get_hamming_index["index_type"] |
| 1519 |
|
logging.getLogger().info(get_hamming_index) |
| 1520 |
|
status = connect.create_partition(ham_collection, tag) |
| 1521 |
|
status, ids = connect.insert(ham_collection, self.vectors, partition_tag=tag) |
| 1522 |
|
status = connect.create_index(ham_collection, index_type, index_param) |
| 1523 |
|
assert status.OK() |
| 1524 |
|
status, res = connect.count_entities(ham_collection) |
| 1525 |
|
assert res == len(self.vectors) |
| 1526 |
|
|
| 1527 |
|
@pytest.mark.timeout(BUILD_TIMEOUT) |
| 1528 |
|
def test_create_index_partition_structure(self, connect, substructure_collection, get_substructure_index): |