[PyGreSQL] [CVS] Change to pygresql: dbapi20.py
Christoph Zwerschke
cito at druid.net
Tue Sep 16 10:35:21 EDT 2008
Update of /usr/cvs/Public/pygresql/module
In directory druid.net:/tmp/cvs-serv6231
Modified Files:
dbapi20.py
Log Message:
Removed spurious tab.
To see the diffs for this commit:
http://www.druid.net/pygresql/viewcvs.cgi/cvs/pygresql/module/dbapi20.py.diff?r1=1.2&r2=1.3
Index: dbapi20.py
===================================================================
RCS file: /usr/cvs/Public/pygresql/module/dbapi20.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- dbapi20.py 22 Jan 2006 13:16:48 -0000 1.2
+++ dbapi20.py 16 Sep 2008 14:35:21 -0000 1.3
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-''' Python DB API 2.0 driver compliance unit test suite.
-
+''' Python DB API 2.0 driver compliance unit test suite.
+
This software is Public Domain and may be used without restrictions.
"Now we have booze and barflies entering the discussion, plus rumours of
@@ -11,14 +11,17 @@
-- Ian Bicking
'''
-__rcs_id__ = '$Id: dbapi20.py,v 1.2 2006/01/22 13:16:48 darcy Exp $'
-__version__ = '$Revision: 1.2 $'[11:-2]
+__rcs_id__ = '$Id: dbapi20.py,v 1.3 2008/09/16 14:35:21 cito Exp $'
+__version__ = '$Revision: 1.3 $'[11:-2]
__author__ = 'Stuart Bishop <zen at shangri-la.dropbear.id.au>'
import unittest
import time
# $Log: dbapi20.py,v $
+# Revision 1.3 2008/09/16 14:35:21 cito
+# Removed spurious tab.
+#
# Revision 1.2 2006/01/22 13:16:48 darcy
# Make error message a little more explanatory.
#
@@ -63,8 +66,8 @@
class DatabaseAPI20Test(unittest.TestCase):
''' Test a database self.driver for DB API 2.0 compatibility.
This implementation tests Gadfly, but the TestCase
- is structured so that other self.drivers can subclass this
- test case to ensure compiliance with the DB-API. It is
+ is structured so that other self.drivers can subclass this
+ test case to ensure compiliance with the DB-API. It is
expected that this TestCase may be expanded in the future
if ambiguities or edge conditions are discovered.
@@ -74,9 +77,9 @@
self.driver, connect_args and connect_kw_args. Class specification
should be as follows:
- import dbapi20
+ import dbapi20
class mytest(dbapi20.DatabaseAPI20Test):
- [...]
+ [...]
Don't 'import DatabaseAPI20Test from dbapi20', or you will
confuse the unit tester - just 'import dbapi20'.
@@ -95,7 +98,7 @@
xddl2 = 'drop table %sbarflys' % table_prefix
lowerfunc = 'lower' # Name of stored procedure to convert string->lowercase
-
+
# Some drivers may need to override these helpers, for example adding
# a 'commit' after the execute.
def executeDDL1(self,cursor):
@@ -119,10 +122,10 @@
try:
cur = con.cursor()
for ddl in (self.xddl1,self.xddl2):
- try:
+ try:
cur.execute(ddl)
con.commit()
- except self.driver.Error:
+ except self.driver.Error:
# Assume table didn't exist. Other tests will check if
# execute is busted.
pass
@@ -214,7 +217,7 @@
con.rollback()
except self.driver.NotSupportedError:
pass
-
+
def test_cursor(self):
con = self._connect()
try:
@@ -368,7 +371,7 @@
)
elif self.driver.paramstyle == 'named':
cur.execute(
- 'insert into %sbooze values (:beer)' % self.table_prefix,
+ 'insert into %sbooze values (:beer)' % self.table_prefix,
{'beer':"Cooper's"}
)
elif self.driver.paramstyle == 'format':
@@ -508,7 +511,7 @@
tests.
'''
populate = [
- "insert into %sbooze values ('%s')" % (self.table_prefix,s)
+ "insert into %sbooze values ('%s')" % (self.table_prefix,s)
for s in self.samples
]
return populate
@@ -570,7 +573,7 @@
self.assertEqual(len(rows),6)
rows = [r[0] for r in rows]
rows.sort()
-
+
# Make sure we get the right data back out
for i in range(0,6):
self.assertEqual(rows[i],self.samples[i],
@@ -641,10 +644,10 @@
'cursor.fetchall should return an empty list if '
'a select query returns no rows'
)
-
+
finally:
con.close()
-
+
def test_mixedfetch(self):
con = self._connect()
try:
@@ -680,8 +683,8 @@
def help_nextset_setUp(self,cur):
''' Should create a procedure called deleteme
- that returns two result sets, first the
- number of rows in booze then "name from booze"
+ that returns two result sets, first the
+ number of rows in booze then "name from booze"
'''
raise NotImplementedError,'Helper not implemented'
#sql="""
More information about the PyGreSQL
mailing list