From f844622b51e52d06f6038e3d4cc96a6e5d3fb45f Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Sun, 20 Feb 2022 05:03:43 +0100 Subject: [PATCH] Added test for CONPY-194 --- testing/test/integration/test_cursor.py | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/testing/test/integration/test_cursor.py b/testing/test/integration/test_cursor.py index 1a07689..a68c255 100644 --- a/testing/test/integration/test_cursor.py +++ b/testing/test/integration/test_cursor.py @@ -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: