Added test for CONPY-194

This commit is contained in:
Georg Richter
2022-02-20 05:03:43 +01:00
parent 1d74599d47
commit f844622b51

View File

@ -1188,6 +1188,35 @@ class TestCursor(unittest.TestCase):
pass
del cursor2, conn
def test_conpy194(self):
conn= create_connection()
cursor= conn.cursor()
cursor.execute("create temporary table t1 (a int not null auto_increment primary key, b varchar(10))")
data= [(1,),(2,),(3,)]
cursor.executemany("insert into t1 values (?, 'foo') returning a", data)
rows= cursor.fetchall()
self.assertEqual(rows, data)
cursor.execute("replace t1 set b='bar' returning a")
rows= cursor.fetchall()
print("***********************************************************")
print(rows)
print("***********************************************************")
cursor.execute("select * from t1")
rows= cursor.fetchall()
print(rows)
cursor.executemany("delete from t1 where a=? returning a", data)
rows= cursor.fetchall()
self.assertEqual(rows, data)
del cursor, conn
def test_conpy91(self):
with create_connection() as connection:
with connection.cursor() as cursor: