Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
aa76fd38
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
aa76fd38
编写于
7月 12, 2022
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix test cases
上级
5d747d52
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
9 deletion
+9
-9
tests/system-test/2-query/To_iso8601.py
tests/system-test/2-query/To_iso8601.py
+9
-9
未找到文件。
tests/system-test/2-query/To_iso8601.py
浏览文件 @
aa76fd38
...
...
@@ -16,18 +16,18 @@ class TDTestCase:
self
.
rowNum
=
10
self
.
ts
=
1640966400000
# 2022-1-1 00:00:00.000
def
check_customize_param_ms
(
self
):
time_zone
=
time
.
strftime
(
'%z'
)
tdSql
.
execute
(
'create database db1 precision "ms"'
)
tdSql
.
execute
(
'use db1'
)
tdSql
.
execute
(
'create table if not exists ntb(ts timestamp, c1 int, c2 timestamp)'
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into ntb values(%d, %d, %d)"
tdSql
.
execute
(
"insert into ntb values(%d, %d, %d)"
%
(
self
.
ts
+
i
,
i
+
1
,
self
.
ts
+
i
))
tdSql
.
query
(
'select to_iso8601(ts) from ntb'
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
f
'2022-01-01T00:00:00.00
{
i
}{
time_zone
}
'
)
timezone_list
=
[
'+0000'
,
'+0100'
,
'+0200'
,
'+0300'
,
'+0330'
,
'+0400'
,
'+0500'
,
'+0530'
,
'+0600'
,
'+0700'
,
'+0800'
,
'+0900'
,
'+1000'
,
'+1100'
,
'+1200'
,
\
'+00'
,
'+01'
,
'+02'
,
'+03'
,
'+04'
,
'+05'
,
'+06'
,
'+07'
,
'+08'
,
'+09'
,
'+10'
,
'+11'
,
'+12'
,
\
'+00:00'
,
'+01:00'
,
'+02:00'
,
'+03:00'
,
'+03:30'
,
'+04:00'
,
'+05:00'
,
'+05:30'
,
'+06:00'
,
'+07:00'
,
'+08:00'
,
'+09:00'
,
'+10:00'
,
'+11:00'
,
'+12:00'
,
\
...
...
@@ -39,7 +39,7 @@ class TDTestCase:
tdSql
.
query
(
f
'select to_iso8601(ts,"
{
j
}
") from ntb'
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
i
][
0
],
f
'2022-01-01T00:00:00.00
{
i
}{
j
}
'
)
error_param_list
=
[
0
,
100.5
,
'a'
,
'!'
]
for
i
in
error_param_list
:
tdSql
.
error
(
f
'select to_iso8601(ts,"
{
i
}
") from ntb'
)
...
...
@@ -47,7 +47,7 @@ class TDTestCase:
error_timezone_param
=
[
'+13'
,
'-13'
,
'+1300'
,
'-1300'
,
'+0001'
,
'-0001'
,
'-0330'
,
'-0530'
]
for
i
in
error_timezone_param
:
tdSql
.
error
(
f
'select to_iso8601(ts,"
{
i
}
") from ntb'
)
def
check_base_function
(
self
):
tdSql
.
prepare
()
tdLog
.
printNoPrefix
(
"==========step1:create tables=========="
)
...
...
@@ -75,12 +75,12 @@ class TDTestCase:
tdSql
.
query
(
"select to_iso8601(ts) from ntb"
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select to_iso8601(ts) from db.ntb"
)
tdSql
.
query
(
"select to_iso8601(today()) from ntb"
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select to_iso8601(now()) from ntb"
)
tdSql
.
checkRows
(
3
)
tdSql
.
error
(
"select to_iso8601(timezone()) from ntb"
)
tdSql
.
error
(
"select to_iso8601('abc') from ntb"
)
...
...
@@ -104,7 +104,7 @@ class TDTestCase:
for
i
in
err_param
:
tdSql
.
error
(
f
"select to_iso8601(
{
i
}
) from ntb"
)
tdSql
.
error
(
f
"select to_iso8601(
{
i
}
) from db.ntb"
)
tdSql
.
query
(
"select to_iso8601(now) from stb"
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select to_iso8601(now()) from stb"
)
...
...
@@ -126,7 +126,7 @@ class TDTestCase:
tdSql
.
query
(
f
"select to_iso8601(today())
{
i
}
null from db.stb"
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkData
(
0
,
0
,
None
)
def
run
(
self
):
# sourcery skip: extract-duplicate-method
self
.
check_base_function
()
self
.
check_customize_param_ms
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录