| @@ 649-664 (lines=16) @@ | ||
| 646 | if field["name"] == binary_field_name: |
|
| 647 | assert field["indexes"][0] == get_binary_index |
|
| 648 | ||
| 649 | @pytest.mark.timeout(ADD_TIMEOUT) |
|
| 650 | def test_insert_binary_create_index(self, connect, binary_collection, get_binary_index): |
|
| 651 | ''' |
|
| 652 | target: test build index insert after vector |
|
| 653 | method: insert vector and build index |
|
| 654 | expected: no error raised |
|
| 655 | ''' |
|
| 656 | ids = connect.bulk_insert(binary_collection, default_binary_entities) |
|
| 657 | assert len(ids) == default_nb |
|
| 658 | connect.flush([binary_collection]) |
|
| 659 | connect.create_index(binary_collection, binary_field_name, get_binary_index) |
|
| 660 | info = connect.get_collection_info(binary_collection) |
|
| 661 | fields = info["fields"] |
|
| 662 | for field in fields: |
|
| 663 | if field["name"] == binary_field_name: |
|
| 664 | assert field["indexes"][0] == get_binary_index |
|
| 665 | ||
| 666 | def test_insert_binary_search(self, connect, binary_collection): |
|
| 667 | ''' |
|
| @@ 331-346 (lines=16) @@ | ||
| 328 | if field["name"] == binary_field_name: |
|
| 329 | assert field["indexes"][0] == get_binary_index |
|
| 330 | ||
| 331 | @pytest.mark.timeout(ADD_TIMEOUT) |
|
| 332 | def test_insert_binary_create_index(self, connect, binary_collection, get_binary_index): |
|
| 333 | ''' |
|
| 334 | target: test build index insert after vector |
|
| 335 | method: insert vector and build index |
|
| 336 | expected: no error raised |
|
| 337 | ''' |
|
| 338 | ids = connect.insert(binary_collection, default_binary_entities_rows) |
|
| 339 | assert len(ids) == default_nb |
|
| 340 | connect.flush([binary_collection]) |
|
| 341 | connect.create_index(binary_collection, binary_field_name, get_binary_index) |
|
| 342 | info = connect.get_collection_info(binary_collection) |
|
| 343 | fields = info["fields"] |
|
| 344 | for field in fields: |
|
| 345 | if field["name"] == binary_field_name: |
|
| 346 | assert field["indexes"][0] == get_binary_index |
|
| 347 | ||
| 348 | ||
| 349 | class TestInsertInvalid(object): |
|
| @@ 315-329 (lines=15) @@ | ||
| 312 | connect.flush([binary_collection]) |
|
| 313 | assert connect.count_entities(binary_collection) == default_nb |
|
| 314 | ||
| 315 | def test_insert_binary_after_create_index(self, connect, binary_collection, get_binary_index): |
|
| 316 | ''' |
|
| 317 | target: test insert binary entities after build index |
|
| 318 | method: build index and insert entities |
|
| 319 | expected: no error raised |
|
| 320 | ''' |
|
| 321 | connect.create_index(binary_collection, binary_field_name, get_binary_index) |
|
| 322 | ids = connect.insert(binary_collection, default_binary_entities_rows) |
|
| 323 | assert len(ids) == default_nb |
|
| 324 | connect.flush([binary_collection]) |
|
| 325 | info = connect.get_collection_info(binary_collection) |
|
| 326 | fields = info["fields"] |
|
| 327 | for field in fields: |
|
| 328 | if field["name"] == binary_field_name: |
|
| 329 | assert field["indexes"][0] == get_binary_index |
|
| 330 | ||
| 331 | @pytest.mark.timeout(ADD_TIMEOUT) |
|
| 332 | def test_insert_binary_create_index(self, connect, binary_collection, get_binary_index): |
|