Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
adminstrot
TDengine
提交
00a07ec7
TDengine
项目概览
adminstrot
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
00a07ec7
编写于
8月 27, 2021
作者:
W
wenzhouwww
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-6289]<test> :modify case codes!
上级
47f39f45
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
2 addition
and
46 deletion
+2
-46
tests/pytest/restful/restful_bind_db1.py
tests/pytest/restful/restful_bind_db1.py
+1
-12
tests/pytest/restful/restful_bind_db2.py
tests/pytest/restful/restful_bind_db2.py
+1
-34
未找到文件。
tests/pytest/restful/restful_bind_db1.py
浏览文件 @
00a07ec7
...
...
@@ -22,8 +22,6 @@ from util.log import *
from
util.cases
import
*
from
util.sql
import
*
import
time
,
datetime
import
requests
,
json
import
threading
import
string
...
...
@@ -97,31 +95,23 @@ class TDTestCase():
"insert into test.tb values (now , 2, 2.0) "
,
"select * from tb"
,
"select * from test.tb"
]
for
sql
in
sqls
:
print
(
"==================="
)
check_unbind_db
(
url
,
sql
,
header
)
print
(
"==================="
*
5
)
print
(
" check bind db about restful "
)
print
(
"==================="
*
5
)
url
=
"http://127.0.0.1:6041/rest/sql/des"
for
sql
in
sqls
:
print
(
"==================="
)
check_bind_db
(
url
,
sql
,
header
)
# check data
tdSql
.
query
(
"select * from test.tb"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"select * from des.tb"
)
tdSql
.
checkRows
(
2
)
os
.
system
(
'sudo timedatectl set-ntp on'
)
...
...
@@ -129,6 +119,5 @@ class TDTestCase():
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
\ No newline at end of file
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/restful/restful_bind_db2.py
浏览文件 @
00a07ec7
...
...
@@ -22,13 +22,10 @@ from util.log import *
from
util.cases
import
*
from
util.sql
import
*
import
time
,
datetime
import
requests
,
json
import
threading
import
string
import
random
def
check_res
(
url
,
data
,
header
):
resp
=
requests
.
post
(
url
,
data
,
headers
=
header
)
...
...
@@ -49,7 +46,6 @@ class TDTestCase():
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
run
(
self
):
tdSql
.
prepare
()
...
...
@@ -59,7 +55,6 @@ class TDTestCase():
tdSql
.
execute
(
'drop database if exists des'
)
tdSql
.
execute
(
'create database test'
)
tdSql
.
execute
(
'create database des'
)
header
=
{
'Authorization'
:
'Basic cm9vdDp0YW9zZGF0YQ=='
}
url
=
"http://127.0.0.1:6041/rest/sql/"
...
...
@@ -87,8 +82,6 @@ class TDTestCase():
"select * from test.tb"
,
"create table des.tb (ts timestamp, id int , data double)"
,
"insert into des.tb values (now , 3, 3.0)"
]
for
sql
in
sqls
:
print
(
"==================="
)
if
sql
==
"create table test.tb (ts timestamp, id int , data double)"
:
...
...
@@ -103,14 +96,10 @@ class TDTestCase():
tdSql
.
query
(
"select * from des.tb"
)
tdSql
.
checkRows
(
1
)
print
(
"==================="
*
5
)
print
(
" check bind db about restful "
)
print
(
"==================="
*
5
)
tdSql
.
execute
(
'reset query cache'
)
tdSql
.
execute
(
'drop database if exists test'
)
tdSql
.
execute
(
'drop database if exists db'
)
...
...
@@ -127,33 +116,11 @@ class TDTestCase():
print
(
"%s run occur error as expect ,check pass!"
%
(
sql
))
else
:
check_res
(
url
,
sql
,
header
)
# check data
tdSql
.
query
(
"select * from test.tb"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"select * from des.tb"
)
tdSql
.
checkRows
(
3
)
# curl(url ,data , header)
# threads = []
# for i in range(self.numOfThreads):
# thread = threading.Thread(target=self.insertData, args=(i,))
# thread.start()
# threads.append(thread)
os
.
system
(
'sudo timedatectl set-ntp on'
)
...
...
@@ -163,4 +130,4 @@ class TDTestCase():
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
\ No newline at end of file
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录