Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
be9fec5f
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看板
提交
be9fec5f
编写于
7月 21, 2022
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(test): fix test cases
上级
97d8f64d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
13 deletion
+13
-13
tests/system-test/2-query/Now.py
tests/system-test/2-query/Now.py
+8
-8
tests/system-test/2-query/irate.py
tests/system-test/2-query/irate.py
+5
-5
未找到文件。
tests/system-test/2-query/Now.py
浏览文件 @
be9fec5f
...
@@ -12,24 +12,24 @@ class TDTestCase:
...
@@ -12,24 +12,24 @@ class TDTestCase:
tdSql
.
init
(
conn
.
cursor
(),
True
)
tdSql
.
init
(
conn
.
cursor
(),
True
)
self
.
setsql
=
TDSetSql
()
self
.
setsql
=
TDSetSql
()
# name of normal table
# name of normal table
self
.
ntbname
=
'ntb'
self
.
ntbname
=
'ntb'
# name of stable
# name of stable
self
.
stbname
=
'stb'
self
.
stbname
=
'stb'
# structure of column
# structure of column
self
.
column_dict
=
{
self
.
column_dict
=
{
'ts'
:
'timestamp'
,
'ts'
:
'timestamp'
,
'c1'
:
'int'
,
'c1'
:
'int'
,
'c2'
:
'float'
,
'c2'
:
'float'
,
'c3'
:
'double'
'c3'
:
'double'
}
}
# structure of tag
# structure of tag
self
.
tag_dict
=
{
self
.
tag_dict
=
{
't0'
:
'int'
't0'
:
'int'
}
}
# number of child tables
# number of child tables
self
.
tbnum
=
2
self
.
tbnum
=
2
# values of tag,the number of values should equal to tbnum
# values of tag,the number of values should equal to tbnum
self
.
tag_values
=
[
self
.
tag_values
=
[
f
'10'
,
f
'10'
,
f
'100'
f
'100'
]
]
...
@@ -43,7 +43,7 @@ class TDTestCase:
...
@@ -43,7 +43,7 @@ class TDTestCase:
self
.
db_percision
=
[
'ms'
,
'us'
,
'ns'
]
self
.
db_percision
=
[
'ms'
,
'us'
,
'ns'
]
def
tbtype_check
(
self
,
tb_type
):
def
tbtype_check
(
self
,
tb_type
):
if
tb_type
==
'normal table'
or
tb_type
==
'child table'
:
if
tb_type
==
'normal table'
or
tb_type
==
'child table'
:
tdSql
.
checkRows
(
len
(
self
.
values_list
))
tdSql
.
checkRows
(
len
(
self
.
values_list
))
elif
tb_type
==
'stable'
:
elif
tb_type
==
'stable'
:
tdSql
.
checkRows
(
len
(
self
.
values_list
)
*
self
.
tbnum
)
tdSql
.
checkRows
(
len
(
self
.
values_list
)
*
self
.
tbnum
)
def
data_check
(
self
,
tbname
,
tb_type
):
def
data_check
(
self
,
tbname
,
tb_type
):
...
@@ -98,7 +98,7 @@ class TDTestCase:
...
@@ -98,7 +98,7 @@ class TDTestCase:
self
.
now_check_ntb
()
self
.
now_check_ntb
()
self
.
now_check_stb
()
self
.
now_check_stb
()
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
...
...
tests/system-test/2-query/irate.py
浏览文件 @
be9fec5f
...
@@ -23,7 +23,7 @@ class TDTestCase:
...
@@ -23,7 +23,7 @@ class TDTestCase:
self
.
time_step
=
1000
self
.
time_step
=
1000
def
insert_datas_and_check_irate
(
self
,
tbnums
,
rownums
,
time_step
):
def
insert_datas_and_check_irate
(
self
,
tbnums
,
rownums
,
time_step
):
tdLog
.
info
(
" prepare datas for auto check irate function "
)
tdLog
.
info
(
" prepare datas for auto check irate function "
)
tdSql
.
execute
(
" create database test "
)
tdSql
.
execute
(
" create database test "
)
...
@@ -48,7 +48,7 @@ class TDTestCase:
...
@@ -48,7 +48,7 @@ class TDTestCase:
c9
=
"'nchar_val'"
c9
=
"'nchar_val'"
c10
=
ts
c10
=
ts
tdSql
.
execute
(
f
" insert into
{
tbname
}
values (
{
ts
}
,
{
c1
}
,
{
c2
}
,
{
c3
}
,
{
c4
}
,
{
c5
}
,
{
c6
}
,
{
c7
}
,
{
c8
}
,
{
c9
}
,
{
c10
}
)"
)
tdSql
.
execute
(
f
" insert into
{
tbname
}
values (
{
ts
}
,
{
c1
}
,
{
c2
}
,
{
c3
}
,
{
c4
}
,
{
c5
}
,
{
c6
}
,
{
c7
}
,
{
c8
}
,
{
c9
}
,
{
c10
}
)"
)
tdSql
.
execute
(
"use test"
)
tdSql
.
execute
(
"use test"
)
tbnames
=
[
"stb"
,
"sub_tb_1"
]
tbnames
=
[
"stb"
,
"sub_tb_1"
]
support_types
=
[
"BIGINT"
,
"SMALLINT"
,
"TINYINT"
,
"FLOAT"
,
"DOUBLE"
,
"INT"
]
support_types
=
[
"BIGINT"
,
"SMALLINT"
,
"TINYINT"
,
"FLOAT"
,
"DOUBLE"
,
"INT"
]
...
@@ -204,11 +204,11 @@ class TDTestCase:
...
@@ -204,11 +204,11 @@ class TDTestCase:
# used for sub table
# used for sub table
tdSql
.
query
(
"select irate(abs(c1+c2)) from ct1"
)
tdSql
.
query
(
"select irate(abs(c1+c2)) from ct1"
)
tdSql
.
checkData
(
0
,
0
,
0.000000000
)
tdSql
.
checkData
(
0
,
0
,
0.000000000
)
# mix with common col
# mix with common col
tdSql
.
error
(
"select c1, irate(c1) from ct1"
)
tdSql
.
error
(
"select c1, irate(c1) from ct1"
)
# mix with common functions
# mix with common functions
tdSql
.
error
(
"select irate(c1), abs(c1) from ct4 "
)
tdSql
.
error
(
"select irate(c1), abs(c1) from ct4 "
)
...
@@ -236,7 +236,7 @@ class TDTestCase:
...
@@ -236,7 +236,7 @@ class TDTestCase:
"select irate(c1+c2)/10 from stb1 where c1 = 5 partition by tbname "
)
"select irate(c1+c2)/10 from stb1 where c1 = 5 partition by tbname "
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
0
,
0.000000000
)
tdSql
.
checkData
(
0
,
0
,
0.000000000
)
def
irate_Arithmetic
(
self
):
def
irate_Arithmetic
(
self
):
pass
pass
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录