[TD-2558]<test>add test case for twa

This commit is contained in:
liuyq-617 2020-12-29 11:29:38 +08:00
parent 33696cb617
commit 3d207a7d03
2 changed files with 14 additions and 1 deletions

View File

@ -120,6 +120,19 @@ class TDTestCase:
tdSql.checkData(2, 1, -1.5) tdSql.checkData(2, 1, -1.5)
tdSql.checkData(3, 1, -2) tdSql.checkData(3, 1, -2)
#TD-2533 twa+interval with large records
tdSql.execute("create table t4(ts timestamp, c int)")
sql = 'insert into t4 values '
for i in range(20000):
sql = sql + '(%d, %d)' % (self.ts + i * 500, i + 1)
if i % 2000 == 0:
tdSql.execute(sql)
sql = 'insert into t4 values '
tdSql.execute(sql)
tdSql.query('select twa(c) from t4 interval(10s)')
tdSql.checkData(0,1,10.999)
def stop(self): def stop(self):
tdSql.close() tdSql.close()
tdLog.success("%s successfully executed" % __file__) tdLog.success("%s successfully executed" % __file__)

View File

@ -231,6 +231,6 @@ python3 test.py -f tools/taosdemoTest2.py
# subscribe # subscribe
python3 test.py -f subscribe/singlemeter.py python3 test.py -f subscribe/singlemeter.py
#python3 test.py -f subscribe/stability.py #python3 test.py -f subscribe/stability.py
python3 test.py -f subscribe/supertable.py python3 test.py -f subscribe/supertable.py