From: brian z. <bz...@us...> - 2002-03-29 04:01:06
|
Update of /cvsroot/jython/jython/Lib/test/zxjdbc In directory usw-pr-cvs1:/tmp/cvs-serv26901/Lib/test/zxjdbc Modified Files: zxtest.py Log Message: cursor is now file-like Index: zxtest.py =================================================================== RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/zxtest.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** zxtest.py 26 Mar 2002 02:46:36 -0000 1.11 --- zxtest.py 29 Mar 2002 04:01:03 -0000 1.12 *************** *** 102,105 **** --- 102,132 ---- c.close() + def testNoneQuery(self): + """testing that executing None doesn't fail""" + c = self.cursor() + try: + c.execute(None) + finally: + c.close() + + def testFileLikeCursor(self): + """testing the cursor as a file-like object""" + c = self.cursor() + try: + print >> c, "insert into zxtesting (id, name, state) values (100, 'test100', 'wa')" + print >> c, "insert into zxtesting (id, name, state) values (101, 'test101', 'co')" + print >> c, "insert into zxtesting (id, name, state) values (102, 'test102', 'or')" + self.db.commit() + finally: + c.close() + + c = self.cursor() + try: + c.execute("select * from zxtesting where id in (100, 101, 102)") + f = c.fetchall() + self.assertEquals(3, len(f)) + finally: + c.close() + def testIteration(self): """testing the iteration protocol""" |