|
From: brian z. <bz...@us...> - 2002-05-10 16:11:44
|
Update of /cvsroot/jython/jython/Lib/test/zxjdbc
In directory usw-pr-cvs1:/tmp/cvs-serv25484/Lib/test/zxjdbc
Modified Files:
zxtest.py test.xml sptest.py dbextstest.py
Log Message:
extensible stored procedures
Index: zxtest.py
===================================================================
RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/zxtest.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** zxtest.py 9 May 2002 01:03:37 -0000 1.16
--- zxtest.py 10 May 2002 16:11:41 -0000 1.17
***************
*** 764,769 ****
c.execute("select * from zxtesting", maxrows=3)
! f = c.fetchall()
! assert len(f) == 3, "expected length [3], got [%d]" % (len(f))
c.execute("select count(*) from zxtesting")
--- 764,771 ----
c.execute("select * from zxtesting", maxrows=3)
! self.assertEquals(3, len(c.fetchall()))
!
! c.execute("select * from zxtesting where id > ?", (1,), maxrows=3)
! self.assertEquals(3, len(c.fetchall()))
c.execute("select count(*) from zxtesting")
***************
*** 772,777 ****
c.execute("select * from zxtesting", maxrows=0)
! f = c.fetchall()
! assert len(f) == num, "expected length [%d], got [%d]" % (num, len(f))
finally:
--- 774,778 ----
c.execute("select * from zxtesting", maxrows=0)
! self.assertEquals(num, len(c.fetchall()))
finally:
Index: test.xml
===================================================================
RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/test.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** test.xml 9 May 2002 01:03:37 -0000 1.8
--- test.xml 10 May 2002 16:11:41 -0000 1.9
***************
*** 210,214 ****
<ignore name="testRowid"/>
</testcase>
- <testcase from="zxtest" import="LOBTestCase"/>
<testcase from="zxtest" import="BCPTestCase"/>
<testcase from="dbextstest" import="dbextsTestCase"/>
--- 210,213 ----
Index: sptest.py
===================================================================
RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/sptest.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sptest.py 9 May 2002 01:03:37 -0000 1.4
--- sptest.py 10 May 2002 16:11:41 -0000 1.5
***************
*** 191,202 ****
c = self.cursor()
try:
! c.execute("use ziclix")
!
! self.assertEquals("ziclix", c.connection.__connection__.getCatalog())
!
! try:
! c.execute("drop table sptest")
! except:
! pass
c.execute("create table sptest (a int, b varchar(32))")
--- 191,199 ----
c = self.cursor()
try:
! for a in (("table", "sptest"), ("procedure", "sp_proctest")):
! try:
! c.execute("drop %s %s" % (a))
! except:
! pass
c.execute("create table sptest (a int, b varchar(32))")
***************
*** 205,220 ****
c.execute("insert into sptest values (3, 'goodbye')")
! try:
! c.execute("drop procedure sp_proctest")
! except:
! pass
!
! c.execute("""
! create procedure sp_proctest (@A int)
! as
! select a, b from sptest where a <= @A
! """)
! c.callproc(("ziclix", "jython", "sp_proctest"), (2,))
data = c.fetchall()
self.assertEquals(2, len(data))
--- 202,209 ----
c.execute("insert into sptest values (3, 'goodbye')")
! c.execute(""" create procedure sp_proctest (@A int) as select a, b from sptest where a <= @A """)
! self.db.commit()
! c.callproc("sp_proctest", (2,))
data = c.fetchall()
self.assertEquals(2, len(data))
***************
*** 227,239 ****
c.close()
! def testSalesByCategory(self):
! c = self.cursor()
! try:
! c.execute("use northwind")
! c.callproc(("northwind", "dbo", "SalesByCategory"), ["Seafood", "1998"])
! data = c.fetchall()
! assert data is not None, "no results from SalesByCategory"
! assert len(data) > 0, "expected numerous results"
! finally:
! c.close()
!
--- 216,227 ----
c.close()
! # def testSalesByCategory(self):
! # c = self.cursor()
! # try:
! # c.execute("use northwind")
! # c.callproc(("northwind", "dbo", "SalesByCategory"), ["Seafood", "1998"])
! # data = c.fetchall()
! # assert data is not None, "no results from SalesByCategory"
! # assert len(data) > 0, "expected numerous results"
! # finally:
! # c.close()
Index: dbextstest.py
===================================================================
RCS file: /cvsroot/jython/jython/Lib/test/zxjdbc/dbextstest.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** dbextstest.py 21 Apr 2002 14:22:15 -0000 1.5
--- dbextstest.py 10 May 2002 16:11:41 -0000 1.6
***************
*** 114,119 ****
self._insertInto("one", 45)
self.db.raw("select * from one where a > ?", [(12,)], maxrows=3)
! assert len(self.db.results) == 3, "failed to query set number of max rows, got [%d], expected [%d]" % (len(self.db.results), 3)
def testBulkcopy(self):
--- 114,121 ----
self._insertInto("one", 45)
+ self.db.raw("select * from one", maxrows=3)
+ self.assertEquals(3, len(self.db.results))
self.db.raw("select * from one where a > ?", [(12,)], maxrows=3)
! self.assertEquals(3, len(self.db.results))
def testBulkcopy(self):
|