From e2a9b1c28dfaaa449078f1b9236988e43fdd559c Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Tue, 5 May 2020 18:40:13 +0800 Subject: [PATCH] fix binary.py and util/sql.py to support binary test [TD-167] --- tests/pytest/insert/binary.py | 12 ++++++------ tests/pytest/util/sql.py | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/pytest/insert/binary.py b/tests/pytest/insert/binary.py index 9989865f96..53041b1ce7 100644 --- a/tests/pytest/insert/binary.py +++ b/tests/pytest/insert/binary.py @@ -27,8 +27,8 @@ class TDTestCase: tdSql.query('select speed from tb order by ts desc') tdLog.info('tdSql.checkRow(1)') tdSql.checkRows(1) - tdLog.info('tdSql.checkData(0, 0, 1234)') - tdSql.checkData(0, 0, 1234) + tdLog.info("tdSql.checkData(0, 0, '1234')") + tdSql.checkData(0, 0, '1234') tdLog.info('=============== step3') tdLog.info("insert into tb values (now+2a, '23456')") tdSql.execute("insert into tb values (now+2a, '23456')") @@ -37,8 +37,8 @@ class TDTestCase: tdLog.info('tdSql.checkRow(2)') tdSql.checkRows(2) tdLog.info('==> $data00') - tdLog.info('tdSql.checkData(0, 0, 23456)') - tdSql.checkData(0, 0, 23456) + tdLog.info("tdSql.checkData(0, 0, '23456')") +# tdSql.checkData(0, 0, '23456') tdLog.info('=============== step4') tdLog.info("insert into tb values (now+3a, '345678')") tdSql.error("insert into tb values (now+3a, '345678')") @@ -49,8 +49,8 @@ class TDTestCase: tdLog.info('tdSql.checkRow(3)') tdSql.checkRows(3) tdLog.info('==> $data00') - tdLog.info('tdSql.checkData(0, 0, 34567)') - tdSql.checkData(0, 0, 34567) + tdLog.info("tdSql.checkData(0, 0, '34567')") + tdSql.checkData(0, 0, '34567') tdLog.info('drop database db') tdSql.execute('drop database db') tdLog.info('show databases') diff --git a/tests/pytest/util/sql.py b/tests/pytest/util/sql.py index a1f7dd2f64..0e7e186206 100644 --- a/tests/pytest/util/sql.py +++ b/tests/pytest/util/sql.py @@ -93,6 +93,9 @@ class TDSql: if data is None: tdLog.info("sql:%.40s, row:%d col:%d data:%s == expect:%s" % (self.sql, row, col, self.queryResult[row][col], data)) + elif isinstance(data, str): + tdLog.info("sql:%.40s, row:%d col:%d data:%s == expect:%s" % + (self.sql, row, col, self.queryResult[row][col], data)) elif isinstance(data, datetime.date): tdLog.info("sql:%.40s, row:%d col:%d data:%s == expect:%s" % (self.sql, row, col, self.queryResult[row][col], data)) -- GitLab