mirror of https://github.com/milvus-io/milvus.git
Add test case: insert/delete on default partition name (#6881)
Resolves: #6879 Signed-off-by: del-zhenwu <zhenxiang.li@zilliz.com>pull/7307/head
parent
181781344f
commit
d0620f61de
|
@ -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
|
||||
|
|
|
@ -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):
|
||||
'''
|
||||
|
|
Loading…
Reference in New Issue