Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
adb3db0c
M
milvus
项目概览
milvus
/
milvus
大约 1 年 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
adb3db0c
编写于
9月 29, 2021
作者:
B
binbin
提交者:
GitHub
9月 29, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[skip ci] Update triple double-quoted string for test case comments (#8866)
Signed-off-by:
N
Binbin Lv
<
binbin.lv@zilliz.com
>
上级
a7a6ff12
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
54 addition
and
54 deletion
+54
-54
tests/python_client/testcases/test_partition.py
tests/python_client/testcases/test_partition.py
+54
-54
未找到文件。
tests/python_client/testcases/test_partition.py
浏览文件 @
adb3db0c
...
...
@@ -17,22 +17,22 @@ class TestCreateBase:
"""
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_create_partition_a
(
self
,
connect
,
collection
):
'''
"""
target: test create partition, check status returned
method: call function: create_partition
expected: status ok
'''
"""
connect
.
create_partition
(
collection
,
default_tag
)
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
@
pytest
.
mark
.
skip
(
reason
=
"skip temporarily for debug"
)
@
pytest
.
mark
.
timeout
(
600
)
def
test_create_partition_limit
(
self
,
connect
,
collection
,
args
):
'''
"""
target: test create partitions, check status returned
method: call function: create_partition for 4097 times
expected: exception raised
'''
"""
threads_num
=
8
threads
=
[]
if
args
[
"handler"
]
==
"HTTP"
:
...
...
@@ -56,11 +56,11 @@ class TestCreateBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_create_partition_repeat
(
self
,
connect
,
collection
):
'''
"""
target: test create partition, check status returned
method: call function: create_partition
expected: status ok
'''
"""
connect
.
create_partition
(
collection
,
default_tag
)
try
:
connect
.
create_partition
(
collection
,
default_tag
)
...
...
@@ -89,11 +89,11 @@ class TestCreateBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_create_partition_name_name_none
(
self
,
connect
,
collection
):
'''
"""
target: test create partition, tag name set None, check status returned
method: call function: create_partition
expected: status ok
'''
"""
tag_name
=
None
try
:
connect
.
create_partition
(
collection
,
tag_name
)
...
...
@@ -114,11 +114,11 @@ class TestCreateBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_create_partition_insert_default
(
self
,
connect
,
id_collection
):
'''
"""
target: test create partition, and insert vectors, check status returned
method: call function: create_partition
expected: status ok
'''
"""
connect
.
create_partition
(
id_collection
,
default_tag
)
ids
=
[
i
for
i
in
range
(
default_nb
)]
result
=
connect
.
insert
(
id_collection
,
default_entities
)
...
...
@@ -126,11 +126,11 @@ class TestCreateBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_create_partition_insert_with_tag
(
self
,
connect
,
id_collection
):
'''
"""
target: test create partition, and insert vectors, check status returned
method: call function: create_partition
expected: status ok
'''
"""
connect
.
create_partition
(
id_collection
,
default_tag
)
ids
=
[
i
for
i
in
range
(
default_nb
)]
result
=
connect
.
insert
(
id_collection
,
default_entities
,
partition_name
=
default_tag
)
...
...
@@ -138,11 +138,11 @@ class TestCreateBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_create_partition_insert_with_tag_not_existed
(
self
,
connect
,
collection
):
'''
"""
target: test create partition, and insert vectors, check status returned
method: call function: create_partition
expected: status not ok
'''
"""
tag_new
=
"tag_new"
connect
.
create_partition
(
collection
,
default_tag
)
ids
=
[
i
for
i
in
range
(
default_nb
)]
...
...
@@ -156,11 +156,11 @@ class TestCreateBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_create_partition_insert_same_tags
(
self
,
connect
,
id_collection
):
'''
"""
target: test create partition, and insert vectors, check status returned
method: call function: create_partition
expected: status ok
'''
"""
connect
.
create_partition
(
id_collection
,
default_tag
)
ids
=
[
i
for
i
in
range
(
default_nb
)]
result
=
connect
.
insert
(
id_collection
,
default_entities
,
partition_name
=
default_tag
)
...
...
@@ -174,11 +174,11 @@ class TestCreateBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_create_partition_insert_same_tags_two_collections
(
self
,
connect
,
collection
):
'''
"""
target: test create two partitions, and insert vectors with the same tag to each collection, check status returned
method: call function: create_partition
expected: status ok, collection length is correct
'''
"""
connect
.
create_partition
(
collection
,
default_tag
)
collection_new
=
gen_unique_str
()
connect
.
create_collection
(
collection_new
,
default_fields
)
...
...
@@ -203,31 +203,31 @@ class TestShowBase:
"""
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_list_partitions
(
self
,
connect
,
collection
):
'''
"""
target: test show partitions, check status and partitions returned
method: create partition first, then call function: list_partitions
expected: status ok, partition correct
'''
"""
connect
.
create_partition
(
collection
,
default_tag
)
assert
compare_list_elements
(
connect
.
list_partitions
(
collection
),
[
default_tag
,
'_default'
])
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_list_partitions_no_partition
(
self
,
connect
,
collection
):
'''
"""
target: test show partitions with collection name, check status and partitions returned
method: call function: list_partitions
expected: status ok, partitions correct
'''
"""
res
=
connect
.
list_partitions
(
collection
)
assert
compare_list_elements
(
res
,
[
'_default'
])
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_show_multi_partitions
(
self
,
connect
,
collection
):
'''
"""
target: test show partitions, check status and partitions returned
method: create partitions first, then call function: list_partitions
expected: status ok, partitions correct
'''
"""
tag_new
=
gen_unique_str
()
connect
.
create_partition
(
collection
,
default_tag
)
connect
.
create_partition
(
collection
,
tag_new
)
...
...
@@ -251,11 +251,11 @@ class TestHasBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_has_partition_a
(
self
,
connect
,
collection
):
'''
"""
target: test has_partition, check status and result
method: create partition first, then call function: has_partition
expected: status ok, result true
'''
"""
connect
.
create_partition
(
collection
,
default_tag
)
res
=
connect
.
has_partition
(
collection
,
default_tag
)
logging
.
getLogger
().
info
(
res
)
...
...
@@ -263,11 +263,11 @@ class TestHasBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_has_partition_multi_partitions
(
self
,
connect
,
collection
):
'''
"""
target: test has_partition, check status and result
method: create partition first, then call function: has_partition
expected: status ok, result true
'''
"""
for
tag_name
in
[
default_tag
,
"tag_new"
,
"tag_new_new"
]:
connect
.
create_partition
(
collection
,
tag_name
)
for
tag_name
in
[
default_tag
,
"tag_new"
,
"tag_new_new"
]:
...
...
@@ -276,22 +276,22 @@ class TestHasBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_has_partition_name_not_existed
(
self
,
connect
,
collection
):
'''
"""
target: test has_partition, check status and result
method: then call function: has_partition, with tag not existed
expected: status ok, result empty
'''
"""
res
=
connect
.
has_partition
(
collection
,
default_tag
)
logging
.
getLogger
().
info
(
res
)
assert
not
res
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_has_partition_collection_not_existed
(
self
,
connect
,
collection
):
'''
"""
target: test has_partition, check status and result
method: then call function: has_partition, with collection not existed
expected: status not ok
'''
"""
collection_name
=
"not_existed_collection"
try
:
connect
.
has_partition
(
collection_name
,
default_tag
)
...
...
@@ -303,11 +303,11 @@ class TestHasBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_has_partition_with_invalid_tag_name
(
self
,
connect
,
collection
,
get_tag_name
):
'''
"""
target: test has partition, with invalid tag name, check status returned
method: call function: has_partition
expected: status ok
'''
"""
tag_name
=
get_tag_name
connect
.
create_partition
(
collection
,
default_tag
)
with
pytest
.
raises
(
Exception
)
as
e
:
...
...
@@ -323,11 +323,11 @@ class TestDropBase:
"""
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_drop_partition_a
(
self
,
connect
,
collection
):
'''
"""
target: test drop partition, check status and partition if existed
method: create partitions first, then call function: drop_partition
expected: status ok, no partitions in db
'''
"""
connect
.
create_partition
(
collection
,
default_tag
)
res1
=
connect
.
list_partitions
(
collection
)
assert
default_tag
in
res1
...
...
@@ -337,11 +337,11 @@ class TestDropBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_drop_partition_name_not_existed
(
self
,
connect
,
collection
):
'''
"""
target: test drop partition, but tag not existed
method: create partitions first, then call function: drop_partition
expected: status not ok
'''
"""
connect
.
create_partition
(
collection
,
default_tag
)
new_tag
=
"new_tag"
try
:
...
...
@@ -354,11 +354,11 @@ class TestDropBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_drop_partition_name_not_existed_A
(
self
,
connect
,
collection
):
'''
"""
target: test drop partition, but collection not existed
method: create partitions first, then call function: drop_partition
expected: status not ok
'''
"""
connect
.
create_partition
(
collection
,
default_tag
)
new_collection
=
gen_unique_str
()
try
:
...
...
@@ -371,11 +371,11 @@ class TestDropBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_drop_partition_repeatedly
(
self
,
connect
,
collection
):
'''
"""
target: test drop partition twice, check status and partition if existed
method: create partitions first, then call function: drop_partition
expected: status not ok, no partitions in db
'''
"""
connect
.
create_partition
(
collection
,
default_tag
)
connect
.
drop_partition
(
collection
,
default_tag
)
time
.
sleep
(
2
)
...
...
@@ -391,11 +391,11 @@ class TestDropBase:
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_drop_partition_create
(
self
,
connect
,
collection
):
'''
"""
target: test drop partition, and create again, check status
method: create partitions first, then call function: drop_partition, create_partition
expected: status not ok, partition in db
'''
"""
connect
.
create_partition
(
collection
,
default_tag
)
assert
compare_list_elements
(
connect
.
list_partitions
(
collection
),
[
default_tag
,
'_default'
])
connect
.
drop_partition
(
collection
,
default_tag
)
...
...
@@ -422,11 +422,11 @@ class TestNameInvalid(object):
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_drop_partition_with_invalid_collection_name
(
self
,
connect
,
collection
,
get_collection_name
):
'''
"""
target: test drop partition, with invalid collection name, check status returned
method: call function: drop_partition
expected: status not ok
'''
"""
collection_name
=
get_collection_name
connect
.
create_partition
(
collection
,
default_tag
)
with
pytest
.
raises
(
Exception
)
as
e
:
...
...
@@ -434,11 +434,11 @@ class TestNameInvalid(object):
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_drop_partition_with_invalid_tag_name
(
self
,
connect
,
collection
,
get_tag_name
):
'''
"""
target: test drop partition, with invalid tag name, check status returned
method: call function: drop_partition
expected: status not ok
'''
"""
tag_name
=
get_tag_name
connect
.
create_partition
(
collection
,
default_tag
)
with
pytest
.
raises
(
Exception
)
as
e
:
...
...
@@ -446,11 +446,11 @@ class TestNameInvalid(object):
@
pytest
.
mark
.
tags
(
CaseLabel
.
L2
)
def
test_list_partitions_with_invalid_collection_name
(
self
,
connect
,
collection
,
get_collection_name
):
'''
"""
target: test show partitions, with invalid collection name, check status returned
method: call function: list_partitions
expected: status not ok
'''
"""
collection_name
=
get_collection_name
connect
.
create_partition
(
collection
,
default_tag
)
with
pytest
.
raises
(
Exception
)
as
e
:
...
...
@@ -461,11 +461,11 @@ class TestNewCase(object):
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_drop_default_partition_A
(
self
,
connect
,
collection
):
'''
"""
target: test drop partition of default, check status returned
method: call function: drop_partition
expected: status not ok
'''
"""
try
:
connect
.
drop_partition
(
collection
,
partition_name
=
'_default'
)
except
Exception
as
e
:
...
...
@@ -478,11 +478,11 @@ class TestNewCase(object):
@
pytest
.
mark
.
tags
(
CaseLabel
.
L0
)
def
test_drop_default_partition_B
(
self
,
connect
,
collection
):
'''
"""
target: test drop partition of default, check status returned
method: call function: drop_partition
expected: status not ok
'''
"""
connect
.
create_partition
(
collection
,
default_tag
)
try
:
connect
.
drop_partition
(
collection
,
partition_name
=
'_default'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录