Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
619bab21
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,发现更多精彩内容 >>
未验证
提交
619bab21
编写于
5月 19, 2022
作者:
J
jingkl
提交者:
GitHub
5月 19, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test]Add the string testcase of delete (#17085)
Signed-off-by:
N
jingkl
<
jingjing.jia@zilliz.com
>
上级
b9568177
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
591 addition
and
6 deletion
+591
-6
tests/python_client/check/func_check.py
tests/python_client/check/func_check.py
+2
-1
tests/python_client/check/param_check.py
tests/python_client/check/param_check.py
+9
-5
tests/python_client/testcases/test_delete.py
tests/python_client/testcases/test_delete.py
+580
-0
未找到文件。
tests/python_client/check/func_check.py
浏览文件 @
619bab21
...
...
@@ -255,9 +255,10 @@ class ResponseChecker:
raise
Exception
(
"No expect values found in the check task"
)
exp_res
=
check_items
.
get
(
"exp_res"
,
None
)
with_vec
=
check_items
.
get
(
"with_vec"
,
False
)
primary_field
=
check_items
.
get
(
"primary_field"
,
None
)
if
exp_res
is
not
None
:
if
isinstance
(
query_res
,
list
):
assert
pc
.
equal_entities_list
(
exp
=
exp_res
,
actual
=
query_res
,
with_vec
=
with_vec
)
assert
pc
.
equal_entities_list
(
exp
=
exp_res
,
actual
=
query_res
,
primary_field
=
primary_field
,
with_vec
=
with_vec
)
return
True
else
:
log
.
error
(
f
"Query result
{
query_res
}
is not list"
)
...
...
tests/python_client/check/param_check.py
浏览文件 @
619bab21
...
...
@@ -148,7 +148,7 @@ def equal_entity(exp, actual):
return
True
def
entity_in
(
entity
,
entities
,
primary_field
=
ct
.
default_int64_field_name
):
def
entity_in
(
entity
,
entities
,
primary_field
):
"""
according to the primary key to judge entity in the entities list
:param entity: dict
...
...
@@ -158,6 +158,8 @@ def entity_in(entity, entities, primary_field=ct.default_int64_field_name):
:param primary_field: collection primary field
:return: True or False
"""
primary_default
=
ct
.
default_int64_field_name
primary_field
=
primary_default
if
primary_field
is
None
else
primary_field
primary_key
=
entity
.
get
(
primary_field
,
None
)
primary_keys
=
[]
for
e
in
entities
:
...
...
@@ -168,7 +170,7 @@ def entity_in(entity, entities, primary_field=ct.default_int64_field_name):
return
equal_entity
(
entities
[
index
],
entity
)
def
remove_entity
(
entity
,
entities
,
primary_field
=
ct
.
default_int64_field_name
):
def
remove_entity
(
entity
,
entities
,
primary_field
):
"""
according to the primary key to remove an entity from an entities list
:param entity: dict
...
...
@@ -178,6 +180,8 @@ def remove_entity(entity, entities, primary_field=ct.default_int64_field_name):
:param primary_field: collection primary field
:return: entities of removed entity
"""
primary_default
=
ct
.
default_int64_field_name
primary_field
=
primary_default
if
primary_field
is
None
else
primary_field
primary_key
=
entity
.
get
(
primary_field
,
None
)
primary_keys
=
[]
for
e
in
entities
:
...
...
@@ -187,7 +191,7 @@ def remove_entity(entity, entities, primary_field=ct.default_int64_field_name):
return
entities
def
equal_entities_list
(
exp
,
actual
,
with_vec
=
False
):
def
equal_entities_list
(
exp
,
actual
,
primary_field
,
with_vec
=
False
):
"""
compare two entities lists in inconsistent order
:param with_vec: whether entities with vec field
...
...
@@ -206,10 +210,10 @@ def equal_entities_list(exp, actual, with_vec=False):
if
with_vec
:
for
a
in
actual
:
# if vec field returned in query res
if
entity_in
(
a
,
exp
):
if
entity_in
(
a
,
exp
,
primary_field
):
try
:
# if vec field returned in query res
remove_entity
(
a
,
exp
)
remove_entity
(
a
,
exp
,
primary_field
)
except
Exception
as
ex
:
log
.
error
(
ex
)
else
:
...
...
tests/python_client/testcases/test_delete.py
浏览文件 @
619bab21
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录