[Zope-Checkins] CVS: Products/DCOracle2/test - test_dcoracle2_dbapi20.py:1.1
Matthew T. Kromer
matt@zope.com
Thu, 13 Feb 2003 19:01:21 -0500
Update of /cvs-repository/Products/DCOracle2/test
In directory cvs.zope.org:/tmp/cvs-serv21635/test
Added Files:
test_dcoracle2_dbapi20.py
Log Message:
DB API 2.0 test suite compatibility fixes
=== Added File Products/DCOracle2/test/test_dcoracle2_dbapi20.py ===
#!/usr/bin/env python
'''
$Id: test_dcoracle2_dbapi20.py,v 1.1 2003/02/14 00:01:21 matt Exp $
'''
__rcs_id__ = '$Id: test_dcoracle2_dbapi20.py,v 1.1 2003/02/14 00:01:21 matt Exp $'
__version__ = '$Revision: 1.1 $'[11:-2]
import dbapi20
import unittest
import DCOracle2 as DB
import popen2
class test_DCOracle2(dbapi20.test_DBAPI20,unittest.TestCase):
driver = DB
connect_args = ('scott/tiger',)
connect_kw_args = {}
ddl1 = 'create table booze (name varchar2(64))'
ddl2 = 'create table barflys (name varchar2(64))'
samples = [
'Carlton Cold',
'Carlton Draft',
'Mountain Goat',
'Redback',
'Victoria Bitter',
'XXXX'
]
populate = [ddl1,] + \
["insert into booze values('%s')" % s for s in samples]
def setUp(self):
# Call superclass setUp In case this does something in the
# future
dbapi20.test_DBAPI20.setUp(self)
con = self._connect()
con.close()
def tearDown(self):
dbapi20.test_DBAPI20.tearDown(self)
def test_nextset(self):
# Assuming DB doesn't implement this
pass
def test_callproc(self):
return
con = DB.connect(**self.connect_kw_args)
try:
cur = con.cursor()
args = ("FOO",)
r = cur.callproc('lower',args)
self.assertEqual(r,args)
r = cur.fetchall()
self.assertEqual(r[0][0],'foo')
finally:
con.close()
def test_setoutputsize(self):
# Does DB implement this?
pass
if __name__ == '__main__':
unittest.main()