Skip to content

Commit

Permalink
Added test for CONPY-194
Browse files Browse the repository at this point in the history
  • Loading branch information
9EOR9 committed Feb 20, 2022
1 parent 1d74599 commit f844622
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions testing/test/integration/test_cursor.py
Expand Up @@ -1188,6 +1188,35 @@ def check_closed(self):
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:
Expand Down

0 comments on commit f844622

Please sign in to comment.