|
@@ 210-224 (lines=15) @@
|
| 207 |
|
res_count = connect.count_entities(id_collection) |
| 208 |
|
assert res_count == nb |
| 209 |
|
|
| 210 |
|
@pytest.mark.timeout(ADD_TIMEOUT) |
| 211 |
|
def test_insert_the_same_ids(self, connect, id_collection, insert_count): |
| 212 |
|
''' |
| 213 |
|
target: test insert vectors in collection, use customize the same ids |
| 214 |
|
method: create collection and insert vectors in it, check the ids returned and the collection length after vectors inserted |
| 215 |
|
expected: the length of ids and the collection row count |
| 216 |
|
''' |
| 217 |
|
nb = insert_count |
| 218 |
|
ids = [1 for i in range(nb)] |
| 219 |
|
res_ids = connect.bulk_insert(id_collection, gen_entities(nb), ids) |
| 220 |
|
connect.flush([id_collection]) |
| 221 |
|
assert len(res_ids) == nb |
| 222 |
|
assert res_ids == ids |
| 223 |
|
res_count = connect.count_entities(id_collection) |
| 224 |
|
assert res_count == nb |
| 225 |
|
|
| 226 |
|
@pytest.mark.timeout(ADD_TIMEOUT) |
| 227 |
|
def test_insert_ids_fields(self, connect, get_filter_field, get_vector_field): |
|
@@ 194-208 (lines=15) @@
|
| 191 |
|
def insert_count(self, request): |
| 192 |
|
yield request.param |
| 193 |
|
|
| 194 |
|
@pytest.mark.timeout(ADD_TIMEOUT) |
| 195 |
|
def test_insert_ids(self, connect, id_collection, insert_count): |
| 196 |
|
''' |
| 197 |
|
target: test insert vectors in collection, use customize ids |
| 198 |
|
method: create collection and insert vectors in it, check the ids returned and the collection length after vectors inserted |
| 199 |
|
expected: the length of ids and the collection row count |
| 200 |
|
''' |
| 201 |
|
nb = insert_count |
| 202 |
|
ids = [i for i in range(nb)] |
| 203 |
|
res_ids = connect.bulk_insert(id_collection, gen_entities(nb), ids) |
| 204 |
|
connect.flush([id_collection]) |
| 205 |
|
assert len(res_ids) == nb |
| 206 |
|
assert res_ids == ids |
| 207 |
|
res_count = connect.count_entities(id_collection) |
| 208 |
|
assert res_count == nb |
| 209 |
|
|
| 210 |
|
@pytest.mark.timeout(ADD_TIMEOUT) |
| 211 |
|
def test_insert_the_same_ids(self, connect, id_collection, insert_count): |