Add test case: insert/delete on default partition name (#6881)

Resolves: #6879 

Signed-off-by: del-zhenwu <zhenxiang.li@zilliz.com>
pull/7307/head
del-zhenwu 2021-07-29 01:53:46 -05:00 committed by GitHub
parent 181781344f
commit d0620f61de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -165,6 +165,23 @@ class TestDeleteBase:
assert status.OK()
assert res == nb-length
def test_delete_vector_from_default_partition(self, connect, collection):
'''
target: test.get_entity_by_id with default partition
method: add vector, and delete
expected: status ok
'''
vectors = gen_vectors(nb, dim)
status, ids = connect.insert(collection, vectors)
status = connect.flush([collection])
length = 2
status = connect.delete_entity_by_id(collection, ids[:length], partition_tag="_default")
assert status.OK()
status = connect.flush([collection])
status, res = connect.count_entities(collection)
assert status.OK()
assert res == nb-length
def test_delete_vector_from_partition_empty(self, connect, collection):
'''
target: test.get_entity_by_id with partition params

View File

@ -491,6 +491,19 @@ class TestAddBase:
assert status.OK()
assert len(ids) == nq
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_default_tag(self, connect, collection):
'''
target: test add vectors in default partition created before
method: create collection and add vectors in it, with the default paritition name
expected: the collection row count equals to nq
'''
nq = 5
vectors = gen_vectors(nq, dim)
status, ids = connect.insert(collection, vectors, partition_tag="_default")
assert status.OK()
assert len(ids) == nq
@pytest.mark.timeout(ADD_TIMEOUT)
def test_insert_tag_A(self, connect, collection):
'''