fix test cases

This commit is contained in:
Ganlin Zhao 2022-07-12 14:49:35 +08:00
parent 547a6bae6c
commit 25b0abf942
1 changed files with 12 additions and 12 deletions

View File

@ -13,24 +13,24 @@ class TDTestCase:
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
tdSql.execute('''create table stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table stb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table stb_1 using stb tags('beijing')") tdSql.execute("create table stb_1 using stb tags('beijing')")
tdSql.execute("create table stb_2 using stb tags('shanghai')") tdSql.execute("create table stb_2 using stb tags('shanghai')")
tdSql.execute('''create table ntb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table ntb(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned)''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned)''')
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into stb_1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" tdSql.execute("insert into stb_1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
tdSql.execute("insert into stb_2 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" tdSql.execute("insert into stb_2 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into ntb values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)" tdSql.execute("insert into ntb values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
tdSql.query("select count(*) from stb") tdSql.query("select count(*) from stb")
tdSql.checkData(0,0,20) tdSql.checkData(0,0,20)
tdSql.query("select count(*) from db.stb") tdSql.query("select count(*) from db.stb")
@ -95,7 +95,7 @@ class TDTestCase:
tdSql.query("select count(ts) from db.stb_1") tdSql.query("select count(ts) from db.stb_1")
tdSql.checkData(0,0,10) tdSql.checkData(0,0,10)
tdSql.query("select count(ts) from db.stb_1") tdSql.query("select count(ts) from db.stb_1")
tdSql.checkData(0,0,10) tdSql.checkData(0,0,10)
tdSql.query("select count(col1) from stb_1") tdSql.query("select count(col1) from stb_1")
@ -171,7 +171,7 @@ class TDTestCase:
tdSql.query("select count(col1),count(ts) from stb") tdSql.query("select count(col1),count(ts) from stb")
tdSql.checkData(0,0,20) tdSql.checkData(0,0,20)
tdSql.checkData(0,1,21) tdSql.checkData(0,1,21)
tdSql.query("select count(col1) from db.stb") tdSql.query("select count(col1) from db.stb")
tdSql.checkData(0,0,20) tdSql.checkData(0,0,20)
tdSql.query("select count(col1),count(ts) from db.stb") tdSql.query("select count(col1),count(ts) from db.stb")
@ -184,7 +184,7 @@ class TDTestCase:
tdSql.query("select count(col1) from stb group by col7") tdSql.query("select count(col1) from stb group by col7")
tdSql.checkRows(3) tdSql.checkRows(3)
def stop(self): def stop(self):
@ -193,4 +193,4 @@ class TDTestCase:
tdCases.addWindows(__file__, TDTestCase()) tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase()) tdCases.addLinux(__file__, TDTestCase())