Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
826cc194
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
826cc194
编写于
11月 09, 2021
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mavg/csum/sample test case developer self test modification
上级
539ec4c9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
64 addition
and
30 deletion
+64
-30
tests/pytest/functions/function_all_sample.py
tests/pytest/functions/function_all_sample.py
+19
-14
tests/pytest/functions/function_csum.py
tests/pytest/functions/function_csum.py
+20
-8
tests/pytest/functions/function_mavg.py
tests/pytest/functions/function_mavg.py
+25
-8
未找到文件。
tests/pytest/functions/function_all_sample.py
浏览文件 @
826cc194
...
...
@@ -388,6 +388,16 @@ class TDTestCase:
self
.
checksample
(
**
case25
)
case26
=
{
"k"
:
1000
}
self
.
checksample
(
**
case26
)
case27
=
{
"table_expr"
:
"stb1"
,
"condition"
:
"group by tbname slimit 1 "
}
self
.
checksample
(
**
case27
)
# with slimit
case28
=
{
"table_expr"
:
"stb1"
,
"condition"
:
"group by tbname slimit 1 soffset 1"
}
self
.
checksample
(
**
case28
)
# with soffset
pass
...
...
@@ -497,16 +507,7 @@ class TDTestCase:
"condition"
:
"group by c6"
}
# self.checksample(**err46) # group by normal col
err47
=
{
"table_expr"
:
"stb1"
,
"condition"
:
"group by tbname slimit 1 "
}
self
.
checksample
(
**
err47
)
# with slimit
err48
=
{
"table_expr"
:
"stb1"
,
"condition"
:
"group by tbname slimit 1 soffset 1"
}
self
.
checksample
(
**
err48
)
# with soffset
err49
=
{
"k"
:
"2021-01-01 00:00:00.000"
}
self
.
checksample
(
**
err49
)
# k: timestamp
err50
=
{
"k"
:
False
}
...
...
@@ -653,10 +654,14 @@ class TDTestCase:
self
.
sample_error_query
()
def
run
(
self
):
# run in develop branch
self
.
sample_test_run
()
pass
import
traceback
try
:
# run in develop branch
self
.
sample_test_run
()
pass
except
Exception
as
e
:
traceback
.
print_exc
()
raise
e
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/pytest/functions/function_csum.py
浏览文件 @
826cc194
...
...
@@ -59,6 +59,12 @@ class TDTestCase:
tdSql
.
checkRows
(
0
)
return
if
"order by tbname"
in
condition
:
tdSql
.
error
(
self
.
csum_query_form
(
col
=
col
,
alias
=
alias
,
table_expr
=
table_expr
,
condition
=
condition
))
return
if
"group"
in
condition
:
tb_condition
=
condition
.
split
(
"group by"
)[
1
].
split
(
" "
)[
1
]
...
...
@@ -195,11 +201,6 @@ class TDTestCase:
# case20~21: with order by
case20
=
{
"condition"
:
"order by ts"
}
self
.
checkcsum
(
**
case20
)
case21
=
{
"table_expr"
:
"stb1"
,
"condition"
:
"group by tbname order by tbname"
}
self
.
checkcsum
(
**
case21
)
# case22: with union
case22
=
{
...
...
@@ -290,6 +291,11 @@ class TDTestCase:
"condition"
:
"group by tbname slimit 1 soffset 1"
}
tdSql
.
error
(
self
.
csum_query_form
(
**
slimit_soffset_sql
))
order_by_tbname_sql
=
{
"table_expr"
:
"stb1"
,
"condition"
:
"group by tbname order by tbname"
}
tdSql
.
error
(
self
.
csum_query_form
(
**
order_by_tbname_sql
))
pass
...
...
@@ -398,9 +404,15 @@ class TDTestCase:
self
.
csum_error_query
()
def
run
(
self
):
# run in develop branch
self
.
csum_test_run
()
pass
import
traceback
try
:
# run in develop branch
self
.
csum_test_run
()
pass
except
Exception
as
e
:
traceback
.
print_exc
()
raise
e
def
stop
(
self
):
...
...
tests/pytest/functions/function_mavg.py
浏览文件 @
826cc194
...
...
@@ -154,6 +154,13 @@ class TDTestCase:
table_expr
=
table_expr
,
condition
=
condition
))
if
"order by tbname"
in
condition
.
lower
():
print
(
f
"case in
{
line
}
: "
,
end
=
''
)
return
tdSql
.
error
(
self
.
mavg_query_form
(
sel
=
sel
,
func
=
func
,
col
=
col
,
m_comm
=
m_comm
,
k
=
k
,
r_comm
=
r_comm
,
alias
=
alias
,
fr
=
fr
,
table_expr
=
table_expr
,
condition
=
condition
))
if
all
([
"group"
in
condition
.
lower
(),
"tbname"
not
in
condition
.
lower
()]):
print
(
f
"case in
{
line
}
: "
,
end
=
''
)
return
tdSql
.
error
(
self
.
mavg_query_form
(
...
...
@@ -356,11 +363,11 @@ class TDTestCase:
# case20~21: with order by
case20
=
{
"condition"
:
"order by ts"
}
self
.
checkmavg
(
**
case20
)
case21
=
{
"table_expr"
:
"stb1"
,
"condition"
:
"group by tbname order by tbname"
}
self
.
checkmavg
(
**
case21
)
#
case21 = {
#
"table_expr": "stb1",
#
"condition": "group by tbname order by tbname"
#
}
#
self.checkmavg(**case21)
# case22: with union
case22
=
{
...
...
@@ -538,6 +545,11 @@ class TDTestCase:
self
.
checkmavg
(
**
err66
)
# k: NULL
err67
=
{
"k"
:
0.999999
}
self
.
checkmavg
(
**
err67
)
# k: left out of [1, 1000]
err68
=
{
"table_expr"
:
"stb1"
,
"condition"
:
"group by tbname order by tbname"
# order by tbname not supported
}
self
.
checkmavg
(
**
err68
)
pass
...
...
@@ -646,9 +658,14 @@ class TDTestCase:
self
.
mavg_error_query
()
def
run
(
self
):
# run in develop branch
self
.
mavg_test_run
()
pass
import
traceback
try
:
# run in develop branch
self
.
mavg_test_run
()
pass
except
Exception
as
e
:
traceback
.
print_exc
()
raise
e
def
stop
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录