提交 be9fec5f 编写于 作者: G Ganlin Zhao

fix(test): fix test cases

上级 97d8f64d
...@@ -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")
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册