Skip to content
This repository was archived by the owner on Jul 11, 2021. It is now read-only.

Commit ea97f7b

Browse files
committed
add test for show statement
1 parent 622a2f4 commit ea97f7b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/correctness/test_v2.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ def test_rdb_persistency_multiple_statements_synchronous(self):
621621
result = self.exec_naked("REDISQL.V2.EXEC", "L", "COmmaNd", "SELECT * FROM t1 ORDER BY A;", "no_HEader", "NoW")
622622
self.assertEqual(result, [["RESULT"], [3], [4], [103], [104]])
623623

624-
class TestListStatements(TestRediSQLWithExec):
624+
class TestStatementsIntrospection(TestRediSQLWithExec):
625625
def compare_results(self, a, b):
626626
self.assertEquals(a[0], b[0]) # 'RESULT'
627627
self.assertEquals(a[1], b[1]) # names
@@ -684,6 +684,20 @@ def test_list_one(self):
684684
['select_all', 'SELECT * from t1', 0, 1],
685685
['select_multiples', "select ?1; select ?2; select ?3;", 3, 1]])
686686

687+
result = self.exec_naked("REDISQL.V2.STATEMENT", "A", "SHOW", "insert")
688+
self.compare_results(result, [['RESULT'],
689+
["identifier", 'SQL', 'parameters_count', 'read_only'],
690+
['TEXT', 'TEXT', 'INT', 'INT'],
691+
['insert', 'insert into t1 values(?1);', 1, 0]
692+
])
693+
694+
result = self.exec_naked("REDISQL.V2.STATEMENT", "A", "SHOW", "select_multiples")
695+
self.compare_results(result, [['RESULT'],
696+
["identifier", 'SQL', 'parameters_count', 'read_only'],
697+
['TEXT', 'TEXT', 'INT', 'INT'],
698+
['select_multiples', "select ?1; select ?2; select ?3;", 3, 1]
699+
])
700+
687701
class TestExecWithArguments(TestRediSQLWithExec):
688702
def test_exec_with_args(self):
689703
with DB(self, "C"):

0 commit comments

Comments
 (0)