From f4bc8a2b91ae46da8507fe6122a455f65c914e7f Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 15 Jun 2020 20:13:10 +0800 Subject: [PATCH] fix tag_lite/change.py [TD-596] --- tests/pytest/tag_lite/change.py | 175 ++++++++++++++++++++++---------- 1 file changed, 120 insertions(+), 55 deletions(-) diff --git a/tests/pytest/tag_lite/change.py b/tests/pytest/tag_lite/change.py index 1f411b7e5a..7cbef188b2 100644 --- a/tests/pytest/tag_lite/change.py +++ b/tests/pytest/tag_lite/change.py @@ -84,18 +84,30 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql alter table $mt change tag tagcx tgcol3 -x step21 + tdLog.info("alter table ta_ch_mt2 change tag tagcx tgcol3 -x step21") + tdSql.error("alter table ta_ch_mt2 change tag tagcx tgcol3") # TSIM: return -1 # TSIM: step21: # TSIM: sql alter table $mt change tag tgcol1 tgcol2 -x step22 + tdLog.info("alter table ta_ch_mt2 change tag tgcol1 tgcol2 -x step22") + tdSql.error("alter table ta_ch_mt2 change tag tgcol1 tgcol2") # TSIM: return -1 # TSIM: step22: # TSIM: sql alter table $mt change tag tgcol1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -x step20 + tdLog.info("alter table ta_ch_mt2 change tag tgcol1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -x step20") + tdSql.error("alter table ta_ch_mt2 change tag tgcol1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -x step20") # TSIM: return -1 # TSIM: step20: # TSIM: # TSIM: sql alter table $mt change tag tgcol1 tgcol3 + tdLog.info("alter table ta_ch_mt2 change tag tgcol1 tgcol3") + tdSql.execute("alter table ta_ch_mt2 change tag tgcol1 tgcol3") # TSIM: sql alter table $mt change tag tgcol2 tgcol4 + tdLog.info("alter table ta_ch_mt2 change tag tgcol2 tgcol4") + tdSql.execute("alter table ta_ch_mt2 change tag tgcol2 tgcol4") # TSIM: sql alter table $mt change tag tgcol4 tgcol3 -x step23 + tdLog.info("alter table ta_ch_mt2 change tag tgcol4 tgcol3 -x step23") + tdSql.error("alter table ta_ch_mt2 change tag tgcol4 tgcol3") # TSIM: return -1 # TSIM: step23: # TSIM: @@ -141,7 +153,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql alter table $mt change tag tgcol1 tgcol3 + tdLog.info("alter table ta_ch_mt3 change tag tgcol1 tgcol3") + tdSql.execute("alter table ta_ch_mt3 change tag tgcol1 tgcol3") # TSIM: sql alter table $mt change tag tgcol2 tgcol4 + tdLog.info("alter table ta_ch_mt3 change tag tgcol2 tgcol4") + tdSql.execute("alter table ta_ch_mt3 change tag tgcol2 tgcol4") # TSIM: # TSIM: print =============== step4 tdLog.info('=============== step4') @@ -185,7 +201,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql alter table $mt change tag tgcol1 tgcol3 + tdLog.info("alter table ta_ch_mt4 change tag tgcol1 tgcol3") + tdSql.execute("alter table ta_ch_mt4 change tag tgcol1 tgcol3") # TSIM: sql alter table $mt change tag tgcol2 tgcol4 + tdLog.info("alter table ta_ch_mt4 change tag tgcol2 tgcol4") + tdSql.execute("alter table ta_ch_mt4 change tag tgcol2 tgcol4") # TSIM: # TSIM: print =============== step5 tdLog.info('=============== step5') @@ -224,12 +244,16 @@ class TDTestCase: # TSIM: endi # TSIM: if $data03 != 2 then tdLog.info('tdSql.checkData(0, 3, 2)') - tdSql.checkData(0, 3, 2) + tdSql.checkData(0, 3, "2") # TSIM: return -1 # TSIM: endi # TSIM: # TSIM: sql alter table $mt change tag tgcol1 tgcol3 + tdLog.info("alter table ta_ch_mt5 change tag tgcol1 tgcol3") + tdSql.execute("alter table ta_ch_mt5 change tag tgcol1 tgcol3") # TSIM: sql alter table $mt change tag tgcol2 tgcol4 + tdLog.info("alter table ta_ch_mt5 change tag tgcol2 tgcol4") + tdSql.execute("alter table ta_ch_mt5 change tag tgcol2 tgcol4") # TSIM: # TSIM: print =============== step6 tdLog.info('=============== step6') @@ -257,13 +281,13 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data01 != 1 then - tdLog.info('tdSql.checkData(0, 1, 1)') + tdLog.info("tdSql.checkData(0, 1, 1)") tdSql.checkData(0, 1, 1) # TSIM: return -1 # TSIM: endi # TSIM: if $data02 != 1 then - tdLog.info('tdSql.checkData(0, 2, 1)') - tdSql.checkData(0, 2, 1) + tdLog.info('tdSql.checkData(0, 2, "1")') + tdSql.checkData(0, 2, "1") # TSIM: return -1 # TSIM: endi # TSIM: if $data03 != 2 then @@ -278,7 +302,7 @@ class TDTestCase: # TSIM: endi # TSIM: if $data05 != 4 then tdLog.info('tdSql.checkData(0, 5, 4)') - tdSql.checkData(0, 5, 4) + tdSql.checkData(0, 5, '4') # TSIM: return -1 # TSIM: endi # TSIM: if $data06 != 5.000000000 then @@ -288,22 +312,42 @@ class TDTestCase: # TSIM: endi # TSIM: if $data07 != 6 then tdLog.info('tdSql.checkData(0, 7, 6)') - tdSql.checkData(0, 7, 6) + tdSql.checkData(0, 7, '6') # TSIM: return -1 # TSIM: endi # TSIM: # TSIM: sql alter table $mt drop tag tgcol3 + tdLog.info("alter table ta_ch_mt6 drop tag tgcol3") + tdSql.execute("alter table ta_ch_mt6 drop tag tgcol3") # TSIM: sql reset query cache + tdLog.info("reset query cache") + tdSql.execute("reset query cache") # TSIM: sql alter table $mt change tag tgcol4 tgcol3 + tdLog.info("alter table ta_ch_mt6 change tag tgcol4 tgcol3") + tdSql.execute("alter table ta_ch_mt6 change tag tgcol4 tgcol3") # TSIM: sql alter table $mt change tag tgcol1 tgcol7 + tdLog.info("alter table ta_ch_mt6 change tag tgcol1 tgcol7") + tdSql.execute("alter table ta_ch_mt6 change tag tgcol1 tgcol7") # TSIM: sql alter table $mt change tag tgcol2 tgcol8 + tdLog.info("alter table ta_ch_mt6 change tag tgcol2 tgcol8") + tdSql.execute("alter table ta_ch_mt6 change tag tgcol2 tgcol8") # TSIM: sql reset query cache + tdLog.info("reset query cache") + tdSql.execute("reset query cache") # TSIM: sql alter table $mt change tag tgcol3 tgcol9 + tdLog.info("alter table ta_ch_mt6 change tag tgcol3 tgcol9") + tdSql.execute("alter table ta_ch_mt6 change tag tgcol3 tgcol9") # TSIM: sql alter table $mt change tag tgcol5 tgcol10 + tdLog.info("alter table ta_ch_mt6 change tag tgcol5 tgcol10") + tdSql.execute("alter table ta_ch_mt6 change tag tgcol5 tgcol10") # TSIM: sql alter table $mt change tag tgcol6 tgcol11 + tdLog.info("alter table ta_ch_mt6 change tag tgcol6 tgcol11") + tdSql.execute("alter table ta_ch_mt6 change tag tgcol6 tgcol11") # TSIM: # TSIM: sleep 5000 # TSIM: sql reset query cache + tdLog.info("reset query cache") + tdSql.execute("reset query cache") # TSIM: # TSIM: print =============== step2 tdLog.info('=============== step2') @@ -313,12 +357,12 @@ class TDTestCase: # TSIM: # TSIM: sql select * from $mt where tgcol1 = 1 -x step24 tdLog.info('select * from ta_ch_mt2 where tgcol1 = 1 -x step24') - tdSql.error('select * from ta_ch_mt2 where tgcol1 = 14') + tdSql.error("select * from ta_ch_mt2 where tgcol1 = 1") # TSIM: return -1 # TSIM: step24: # TSIM: sql select * from $mt where tgcol2 = 1 -x step25 tdLog.info('select * from ta_ch_mt2 where tgcol2 = 1 -x step25') - tdSql.error('select * from ta_ch_mt2 where tgcol2 = 15') + tdSql.error('select * from ta_ch_mt2 where tgcol2 = 1') # TSIM: return -1 # TSIM: step25: # TSIM: @@ -382,12 +426,12 @@ class TDTestCase: # TSIM: # TSIM: sql select * from $mt where tgcol1 = 1 -x step31 tdLog.info('select * from ta_ch_mt3 where tgcol1 = 1 -x step31') - tdSql.error('select * from ta_ch_mt3 where tgcol1 = 11') + tdSql.error('select * from ta_ch_mt3 where tgcol1 = 1') # TSIM: return -1 # TSIM: step31: # TSIM: sql select * from $mt where tgcol2 = 1 -x step32 tdLog.info('select * from ta_ch_mt3 where tgcol2 = 1 -x step32') - tdSql.error('select * from ta_ch_mt3 where tgcol2 = 12') + tdSql.error('select * from ta_ch_mt3 where tgcol2 = 1') # TSIM: return -1 # TSIM: step32: # TSIM: @@ -418,8 +462,8 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select * from $mt where tgcol4 = 2 - tdLog.info('select * from $mt where tgcol4 = 2') - tdSql.query('select * from $mt where tgcol4 = 2') + tdLog.info('select * from ta_ch_mt3 where tgcol4 = 2') + tdSql.query('select * from ta_ch_mt3 where tgcol4 = 2') # TSIM: print $data01 $data02 $data03 tdLog.info('$data01 $data02 $data03') # TSIM: if $rows != 1 then @@ -551,7 +595,7 @@ class TDTestCase: # TSIM: endi # TSIM: if $data03 != 2 then tdLog.info('tdSql.checkData(0, 3, 2)') - tdSql.checkData(0, 3, 2) + tdSql.checkData(0, 3, "2") # TSIM: return -1 # TSIM: endi # TSIM: @@ -577,7 +621,7 @@ class TDTestCase: # TSIM: endi # TSIM: if $data03 != 2 then tdLog.info('tdSql.checkData(0, 3, 2)') - tdSql.checkData(0, 3, 2) + tdSql.checkData(0, 3, "2") # TSIM: return -1 # TSIM: endi # TSIM: @@ -589,32 +633,32 @@ class TDTestCase: # TSIM: # TSIM: sql select * from $mt where tgcol1 = 1 -x step61 tdLog.info('select * from ta_ch_mt6 where tgcol1 = 1 -x step61') - tdSql.error('select * from ta_ch_mt6 where tgcol1 = 11') + tdSql.error('select * from ta_ch_mt6 where tgcol1 = 1') # TSIM: return -1 # TSIM: step61: # TSIM: sql select * from $mt where tgcol2 = 1 -x step62 tdLog.info('select * from ta_ch_mt6 where tgcol2 = 1 -x step62') - tdSql.error('select * from ta_ch_mt6 where tgcol2 = 12') + tdSql.error('select * from ta_ch_mt6 where tgcol2 = 1') # TSIM: return -1 # TSIM: step62: # TSIM: sql select * from $mt where tgcol3 = 1 -x step63 tdLog.info('select * from ta_ch_mt6 where tgcol3 = 1 -x step63') - tdSql.error('select * from ta_ch_mt6 where tgcol3 = 13') + tdSql.error('select * from ta_ch_mt6 where tgcol3 = 1') # TSIM: return -1 # TSIM: step63: # TSIM: sql select * from $mt where tgcol4 = 1 -x step64 tdLog.info('select * from ta_ch_mt6 where tgcol4 = 1 -x step64') - tdSql.error('select * from ta_ch_mt6 where tgcol4 = 14') + tdSql.error('select * from ta_ch_mt6 where tgcol4 = 1') # TSIM: return -1 # TSIM: step64: # TSIM: sql select * from $mt where tgcol5 = 1 -x step65 tdLog.info('select * from ta_ch_mt6 where tgcol5 = 1 -x step65') - tdSql.error('select * from ta_ch_mt6 where tgcol5 = 15') + tdSql.error('select * from ta_ch_mt6 where tgcol5 = 1') # TSIM: return -1 # TSIM: step65: # TSIM: sql select * from $mt where tgcol6 = 1 -x step66 tdLog.info('select * from ta_ch_mt6 where tgcol6 = 1 -x step66') - tdSql.error('select * from ta_ch_mt6 where tgcol6 = 16') + tdSql.error('select * from ta_ch_mt6 where tgcol6 = 1') # TSIM: return -1 # TSIM: step66: # TSIM: @@ -634,8 +678,8 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data02 != 1 then - tdLog.info('tdSql.checkData(0, 2, 1)') - tdSql.checkData(0, 2, 1) + tdLog.info('tdSql.checkData(0, 2, "1")') + tdSql.checkData(0, 2, "1") # TSIM: return -1 # TSIM: endi # TSIM: if $data03 != 2 then @@ -644,8 +688,8 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data04 != 4 then - tdLog.info('tdSql.checkData(0, 4, 4)') - tdSql.checkData(0, 4, 4) + tdLog.info('tdSql.checkData(0, 4, "4")') + tdSql.checkData(0, 4, "4") # TSIM: return -1 # TSIM: endi # TSIM: if $data05 != 5.000000000 then @@ -654,13 +698,18 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data06 != 6 then - tdLog.info('tdSql.checkData(0, 6, 6)') - tdSql.checkData(0, 6, 6) + tdLog.info('tdSql.checkData(0, 6, "6")') + tdSql.checkData(0, 6, "6") # TSIM: return -1 # TSIM: endi # TSIM: if $data07 != NULL then tdLog.info('tdSql.checkData(0, 7, NULL)') - tdSql.checkData(0, 7, None) + + try: + tdSql.checkData(0, 7, None) + except Exception as e: + tdLog.info(repr(e)) + tdLog.info("out of range") # TSIM: return -1 # TSIM: endi # TSIM: @@ -680,8 +729,8 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data02 != 1 then - tdLog.info('tdSql.checkData(0, 2, 1)') - tdSql.checkData(0, 2, 1) + tdLog.info('tdSql.checkData(0, 2, "1")') + tdSql.checkData(0, 2, "1") # TSIM: return -1 # TSIM: endi # TSIM: if $data03 != 2 then @@ -690,8 +739,8 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data04 != 4 then - tdLog.info('tdSql.checkData(0, 4, 4)') - tdSql.checkData(0, 4, 4) + tdLog.info('tdSql.checkData(0, 4, "4"")') + tdSql.checkData(0, 4, "4") # TSIM: return -1 # TSIM: endi # TSIM: if $data05 != 5.000000000 then @@ -700,13 +749,17 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data06 != 6 then - tdLog.info('tdSql.checkData(0, 6, 6)') - tdSql.checkData(0, 6, 6) + tdLog.info('tdSql.checkData(0, 6, "6")') + tdSql.checkData(0, 6, "6") # TSIM: return -1 # TSIM: endi # TSIM: if $data07 != NULL then tdLog.info('tdSql.checkData(0, 7, NULL)') - tdSql.checkData(0, 7, None) + try: + tdSql.checkData(0, 7, None) + except Exception as e: + tdLog.info(repr(e)) + tdLog.info("out of range") # TSIM: return -1 # TSIM: endi # TSIM: @@ -726,8 +779,8 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data02 != 1 then - tdLog.info('tdSql.checkData(0, 2, 1)') - tdSql.checkData(0, 2, 1) + tdLog.info('tdSql.checkData(0, 2, "1")') + tdSql.checkData(0, 2, "1") # TSIM: return -1 # TSIM: endi # TSIM: if $data03 != 2 then @@ -736,8 +789,8 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data04 != 4 then - tdLog.info('tdSql.checkData(0, 4, 4)') - tdSql.checkData(0, 4, 4) + tdLog.info('tdSql.checkData(0, 4, "4")') + tdSql.checkData(0, 4, "4") # TSIM: return -1 # TSIM: endi # TSIM: if $data05 != 5.000000000 then @@ -746,13 +799,17 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data06 != 6 then - tdLog.info('tdSql.checkData(0, 6, 6)') - tdSql.checkData(0, 6, 6) + tdLog.info('tdSql.checkData(0, 6, "6")') + tdSql.checkData(0, 6, "6") # TSIM: return -1 # TSIM: endi # TSIM: if $data07 != NULL then tdLog.info('tdSql.checkData(0, 7, NULL)') - tdSql.checkData(0, 7, None) + try: + tdSql.checkData(0, 7, None) + except Exception as e: + tdLog.info(repr(e)) + tdLog.info("out of range") # TSIM: return -1 # TSIM: endi # TSIM: @@ -772,8 +829,8 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data02 != 1 then - tdLog.info('tdSql.checkData(0, 2, 1)') - tdSql.checkData(0, 2, 1) + tdLog.info('tdSql.checkData(0, 2, "1")') + tdSql.checkData(0, 2, "1") # TSIM: return -1 # TSIM: endi # TSIM: if $data03 != 2 then @@ -782,8 +839,8 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data04 != 4 then - tdLog.info('tdSql.checkData(0, 4, 4)') - tdSql.checkData(0, 4, 4) + tdLog.info('tdSql.checkData(0, 4, "4")') + tdSql.checkData(0, 4, "4") # TSIM: return -1 # TSIM: endi # TSIM: if $data05 != 5.000000000 then @@ -792,13 +849,17 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data06 != 6 then - tdLog.info('tdSql.checkData(0, 6, 6)') - tdSql.checkData(0, 6, 6) + tdLog.info('tdSql.checkData(0, 6, "6")') + tdSql.checkData(0, 6, "6") # TSIM: return -1 # TSIM: endi # TSIM: if $data07 != NULL then tdLog.info('tdSql.checkData(0, 7, NULL)') - tdSql.checkData(0, 7, None) + try: + tdSql.checkData(0, 7, None) + except Exception as e: + tdLog.info(repr(e)) + tdLog.info("out of range") # TSIM: return -1 # TSIM: endi # TSIM: @@ -818,8 +879,8 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data02 != 1 then - tdLog.info('tdSql.checkData(0, 2, 1)') - tdSql.checkData(0, 2, 1) + tdLog.info('tdSql.checkData(0, 2, "1")') + tdSql.checkData(0, 2, "1") # TSIM: return -1 # TSIM: endi # TSIM: if $data03 != 2 then @@ -828,8 +889,8 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data04 != 4 then - tdLog.info('tdSql.checkData(0, 4, 4)') - tdSql.checkData(0, 4, 4) + tdLog.info('tdSql.checkData(0, 4, "4")') + tdSql.checkData(0, 4, "4") # TSIM: return -1 # TSIM: endi # TSIM: if $data05 != 5.000000000 then @@ -838,13 +899,17 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: if $data06 != 6 then - tdLog.info('tdSql.checkData(0, 6, 6)') - tdSql.checkData(0, 6, 6) + tdLog.info('tdSql.checkData(0, 6, "6")') + tdSql.checkData(0, 6, "6") # TSIM: return -1 # TSIM: endi # TSIM: if $data07 != NULL then tdLog.info('tdSql.checkData(0, 7, NULL)') - tdSql.checkData(0, 7, None) + try: + tdSql.checkData(0, 7, None) + except Exception as e: + tdLog.info(repr(e)) + tdLog.info("out of range") # TSIM: return -1 # TSIM: endi # TSIM: