Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d3fd2e4b
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看板
提交
d3fd2e4b
编写于
7月 06, 2022
作者:
J
jiacy-jcy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update test case
上级
2d01ad67
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
9 addition
and
6 deletion
+9
-6
tests/system-test/2-query/Timediff.py
tests/system-test/2-query/Timediff.py
+3
-3
tests/system-test/2-query/timetruncate.py
tests/system-test/2-query/timetruncate.py
+6
-3
未找到文件。
tests/system-test/2-query/Timediff.py
浏览文件 @
d3fd2e4b
...
...
@@ -17,8 +17,8 @@ class TDTestCase:
]
self
.
db_param_precision
=
[
'ms'
,
'us'
,
'ns'
]
self
.
time_unit
=
[
'1w'
,
'1d'
,
'1h'
,
'1m'
,
'1s'
,
'1a'
,
'1u'
]
self
.
error_unit
=
[
'
1b'
,
'
2w'
,
'2d'
,
'2h'
,
'2m'
,
'2s'
,
'2a'
,
'2u'
,
'1c'
,
'#1'
]
self
.
time_unit
=
[
'1w'
,
'1d'
,
'1h'
,
'1m'
,
'1s'
,
'1a'
,
'1u'
,
'1b'
]
self
.
error_unit
=
[
'2w'
,
'2d'
,
'2h'
,
'2m'
,
'2s'
,
'2a'
,
'2u'
,
'1c'
,
'#1'
]
self
.
ntbname
=
'ntb'
self
.
stbname
=
'stb'
self
.
ctbname
=
'ctb'
...
...
@@ -39,7 +39,7 @@ class TDTestCase:
tdSql
.
query
(
f
'select timediff(ts,
{
self
.
subtractor
}
,
{
unit
}
) from
{
self
.
stbname
}
'
)
def
data_check
(
self
,
date_time
,
precision
,
tb_type
):
for
unit
in
self
.
time_unit
:
if
(
unit
.
lower
()
==
'1u'
and
precision
.
lower
()
==
'ms'
)
or
(
)
:
if
(
unit
.
lower
()
==
'1u'
and
precision
.
lower
()
==
'ms'
)
or
(
unit
.
lower
()
==
'1b'
and
precision
.
lower
()
==
'us'
)
or
(
unit
.
lower
()
==
'1b'
and
precision
.
lower
()
==
'ms'
)
:
if
tb_type
.
lower
()
==
'ntb'
:
tdSql
.
error
(
f
'select timediff(ts,
{
self
.
subtractor
}
,
{
unit
}
) from
{
self
.
ntbname
}
'
)
elif
tb_type
.
lower
()
==
'ctb'
:
...
...
tests/system-test/2-query/timetruncate.py
浏览文件 @
d3fd2e4b
...
...
@@ -19,7 +19,7 @@ class TDTestCase:
'2020-5-1 00:00:00.001002001'
]
self
.
db_param_precision
=
[
'ms'
,
'us'
,
'ns'
]
self
.
time_unit
=
[
'1w'
,
'1d'
,
'1h'
,
'1m'
,
'1s'
,
'1a'
,
'1u'
]
self
.
time_unit
=
[
'1w'
,
'1d'
,
'1h'
,
'1m'
,
'1s'
,
'1a'
,
'1u'
,
'1b'
]
self
.
error_unit
=
[
'2w'
,
'2d'
,
'2h'
,
'2m'
,
'2s'
,
'2a'
,
'2u'
,
'1c'
,
'#1'
]
self
.
error_unit
=
[
'2w'
,
'2d'
,
'2h'
,
'2m'
,
'2s'
,
'2a'
,
'2u'
,
'1c'
,
'#1'
]
self
.
ntbname
=
'ntb'
...
...
@@ -80,7 +80,10 @@ class TDTestCase:
ts_result
=
self
.
get_time
.
get_us_timestamp
(
str
(
tdSql
.
queryResult
[
i
][
0
]))
tdSql
.
checkEqual
(
ts_result
,
int
(
date_time
[
i
]
/
1000
/
1000
/
60
/
60
/
24
/
7
)
*
7
*
24
*
60
*
60
*
1000
*
1000
)
def
check_ns_timestamp
(
self
,
unit
,
date_time
):
if
unit
.
lower
()
==
'1u'
:
if
unit
.
lower
()
==
'1b'
:
for
i
in
range
(
len
(
self
.
ts_str
)):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]))
elif
unit
.
lower
()
==
'1u'
:
for
i
in
range
(
len
(
self
.
ts_str
)):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
int
(
date_time
[
i
]
*
1000
/
1000
/
1000
)
*
1000
)
elif
unit
.
lower
()
==
'1a'
:
...
...
@@ -110,7 +113,7 @@ class TDTestCase:
tdSql
.
query
(
f
'select timetruncate(ts,
{
unit
}
) from
{
self
.
stbname
}
'
)
def
data_check
(
self
,
date_time
,
precision
,
tb_type
):
for
unit
in
self
.
time_unit
:
if
(
unit
.
lower
()
==
'1u'
and
precision
.
lower
()
==
'ms'
)
or
(
unit
.
lower
()
==
'1b'
and
precision
.
lower
()
==
'us'
):
if
(
unit
.
lower
()
==
'1u'
and
precision
.
lower
()
==
'ms'
)
or
(
unit
.
lower
()
==
'1b'
and
precision
.
lower
()
==
'us'
)
or
(
unit
.
lower
()
==
'1b'
and
precision
.
lower
()
==
'ms'
)
:
if
tb_type
.
lower
()
==
'ntb'
:
tdSql
.
error
(
f
'select timetruncate(ts,
{
unit
}
) from
{
self
.
ntbname
}
'
)
elif
tb_type
.
lower
()
==
'ctb'
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录