From 84cf8ff273bd9ab74b3ec8711c0e163648342b98 Mon Sep 17 00:00:00 2001 From: jiajingbin Date: Wed, 25 May 2022 18:00:58 +0800 Subject: [PATCH] test: add debug cases --- tests/pytest/stream/test1.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/pytest/stream/test1.py diff --git a/tests/pytest/stream/test1.py b/tests/pytest/stream/test1.py new file mode 100644 index 0000000000..d3439a7bdb --- /dev/null +++ b/tests/pytest/stream/test1.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- + +import sys +from util.log import * +from util.cases import * +from util.sql import * +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + tdSql.prepare() + tdSql.execute('drop database if exists slmfvojuxt;') + tdSql.execute('create database if not exists slmfvojuxt vgroups 1;') + tdSql.execute('use slmfvojuxt;') + tdSql.execute('create table if not exists downsampling_stb (ts timestamp, c1 int, c2 double, c3 varchar(100), c4 bool) tags (t1 int, t2 double, t3 varchar(100), t4 bool);') + tdSql.execute('create table ownsampling_ct1 using downsampling_stb tags(10, 10.1, "beijing", True);') + tdSql.execute('create table if not exists scalar_stb (ts timestamp, c1 int, c2 double, c3 binary(20)) tags (t1 int);') + tdSql.execute('create table scalar_ct1 using scalar_stb tags(10);') + tdSql.execute('create stream downsampling_stream into output_downsampling_stb as select _wstartts AS start, min(c1), max(c2), sum(c1) from downsampling_stb interval(10m);') + tdSql.execute('create stream scalar_stream into output_scalar_stb as select ts, abs(c1) a1 , abs(c2) a2 from scalar_stb;') + tdSql.execute('insert into scalar_ct1 values (1653471881952, 100, 100.1, "beijing");') + tdSql.execute('insert into scalar_ct1 values (1653471881952+1s, -50, -50.1, "tianjin");') + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) -- GitLab