[Zope3-checkins] CVS: Zope3/src/zope/app/rdb/tests - stubs.py:1.1.2.2 test_dsnparser.py:1.1.2.2 test_gadflyadapter.py:1.1.2.2 test_resultset.py:1.1.2.2 test_zopeconnection.py:1.1.2.2 test_zopedatabaseadapter.py:1.1.2.2 test_zopedbtransactionmanager.py:1.1.2.2
Tim Peters
tim.one@comcast.net
Tue, 24 Dec 2002 21:21:45 -0500
Update of /cvs-repository/Zope3/src/zope/app/rdb/tests
In directory cvs.zope.org:/tmp/cvs-serv19240/src/zope/app/rdb/tests
Modified Files:
Tag: NameGeddon-branch
stubs.py test_dsnparser.py test_gadflyadapter.py
test_resultset.py test_zopeconnection.py
test_zopedatabaseadapter.py test_zopedbtransactionmanager.py
Log Message:
Whitespace normalization, via Python's Tools/scripts/reindent.py. The
files are fixed-points of that script now. Fixed a few cases where
code relied on significant trailing whitespace (ouch).
=== Zope3/src/zope/app/rdb/tests/stubs.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/rdb/tests/stubs.py:1.1.2.1 Mon Dec 23 14:32:12 2002
+++ Zope3/src/zope/app/rdb/tests/stubs.py Tue Dec 24 21:20:44 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
-#
+#
##############################################################################
"""Stubs for Zope RDB unit tests.
@@ -20,7 +20,7 @@
def __init__(self):
self._called={}
-
+
def cursor(self):
return CursorStub()
@@ -30,7 +30,7 @@
def commit(self, *ignored):
v = self._called.setdefault('commit',0)
v+=1
- self._called['commit']=v
+ self._called['commit']=v
def rollback(self, *ignored):
v = self._called.setdefault('rollback',0)
v+=1
@@ -45,4 +45,3 @@
threadsafety = 0
def getConverter(self, type):
return lambda x: x
-
=== Zope3/src/zope/app/rdb/tests/test_dsnparser.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/rdb/tests/test_dsnparser.py:1.1.2.1 Mon Dec 23 14:32:12 2002
+++ Zope3/src/zope/app/rdb/tests/test_dsnparser.py Tue Dec 24 21:20:44 2002
@@ -70,4 +70,3 @@
if __name__ == '__main__':
unittest.TextTestRunner().run(test_suite())
-
=== Zope3/src/zope/app/rdb/tests/test_gadflyadapter.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/rdb/tests/test_gadflyadapter.py:1.1.2.1 Mon Dec 23 14:32:12 2002
+++ Zope3/src/zope/app/rdb/tests/test_gadflyadapter.py Tue Dec 24 21:20:44 2002
@@ -45,25 +45,25 @@
class GadflyTestBase(TestCase):
def setUp(self):
- TestCase.setUp(self)
- self.tempdir = None
+ TestCase.setUp(self)
+ self.tempdir = None
def tearDown(self):
- TestCase.tearDown(self)
- if self.tempdir:
- os.rmdir(self.tempdir)
+ TestCase.tearDown(self)
+ if self.tempdir:
+ os.rmdir(self.tempdir)
def getGadflyRoot(self):
- # note that self is GadflyTestBase here
- if not self.tempdir:
- self.tempdir = mkdtemp('gadfly')
- return self.tempdir
-
+ # note that self is GadflyTestBase here
+ if not self.tempdir:
+ self.tempdir = mkdtemp('gadfly')
+ return self.tempdir
+
def _create(self, *args):
- from zope.app.rdb.gadflyda import GadflyAdapter
- obj = GadflyAdapter(*args)
- obj._getGadflyRoot = self.getGadflyRoot
- return obj
+ from zope.app.rdb.gadflyda import GadflyAdapter
+ obj = GadflyAdapter(*args)
+ obj._getGadflyRoot = self.getGadflyRoot
+ return obj
class TestGadflyAdapter(GadflyTestBase):
@@ -99,20 +99,20 @@
def setUp(self):
# Create a directory for the database.
- GadflyTestBase.setUp(self)
- dir = self.getGadflyRoot()
+ GadflyTestBase.setUp(self)
+ dir = self.getGadflyRoot()
os.mkdir(os.path.join(dir, "test"))
def tearDown(self):
# Remove the files and directories created.
- dir = self.getGadflyRoot()
+ dir = self.getGadflyRoot()
try: os.unlink(os.path.join(dir, "test", "demo.gfd"))
except: pass
os.rmdir(os.path.join(dir, "test"))
try: os.unlink(os.path.join(dir, "regular"))
except: pass
- GadflyTestBase.tearDown(self)
-
+ GadflyTestBase.tearDown(self)
+
class TestGadflyAdapterDefault(GadflyTestBase):
"""Test with pre-existing databases"""
@@ -130,23 +130,23 @@
conn.rollback() # is it really a connection?
conn.close()
- conn = a._connection_factory()
+ conn = a._connection_factory()
conn.rollback() # is it really a connection?
def setUp(self):
# Create a directory for the database.
- GadflyTestBase.setUp(self)
- dir = self.getGadflyRoot()
+ GadflyTestBase.setUp(self)
+ dir = self.getGadflyRoot()
os.mkdir(os.path.join(dir, "demo"))
def tearDown(self):
# Remove the files and directories created.
- dir = self.getGadflyRoot()
+ dir = self.getGadflyRoot()
try: os.unlink(os.path.join(dir, "demo", "demo.gfd"))
except: pass
os.rmdir(os.path.join(dir, "demo"))
- GadflyTestBase.tearDown(self)
-
+ GadflyTestBase.tearDown(self)
+
def test_suite():
return TestSuite((
=== Zope3/src/zope/app/rdb/tests/test_resultset.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/rdb/tests/test_resultset.py:1.1.2.1 Mon Dec 23 14:32:12 2002
+++ Zope3/src/zope/app/rdb/tests/test_resultset.py Tue Dec 24 21:20:44 2002
@@ -19,11 +19,11 @@
from unittest import TestCase, TestSuite, main, makeSuite
class TestResultSet(TestCase):
-
+
def testPickling(self):
from zope.app.rdb import ResultSet
from pickle import dumps, loads
-
+
columns = ('foo', 'bar')
rows = (('1', '2'), ('3', '4'))
rs = ResultSet(columns, rows)
@@ -33,7 +33,7 @@
#self.assertEqual(unpickled.columns, rs.columns)
self.assertEqual(rs, unpickled)
-
+
def test__cmp__(self):
from zope.app.rdb import ResultSet
from copy import deepcopy
@@ -62,7 +62,7 @@
rs2 = ResultSet(columns, rows2)
self.assert_(rs1 < rs2, "different columns compared incorrectly")
-
+
def test_suite():
return TestSuite((
=== Zope3/src/zope/app/rdb/tests/test_zopeconnection.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/rdb/tests/test_zopeconnection.py:1.1.2.1 Mon Dec 23 14:32:13 2002
+++ Zope3/src/zope/app/rdb/tests/test_zopeconnection.py Tue Dec 24 21:20:44 2002
@@ -26,7 +26,7 @@
def test_cursor(self):
zc = ZopeConnection(ConnectionStub(), TypeInfoStub())
cursor = zc.cursor()
-
+
self.failUnless(IZopeCursor.isImplementedBy(cursor),
"cursor is not what we expected")
@@ -68,7 +68,7 @@
def tearDown(self):
"Abort the transaction"
get_transaction().abort()
-
+
def test_suite():
return makeSuite(ZopeConnectionTests)
=== Zope3/src/zope/app/rdb/tests/test_zopedatabaseadapter.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/rdb/tests/test_zopedatabaseadapter.py:1.1.2.1 Mon Dec 23 14:32:13 2002
+++ Zope3/src/zope/app/rdb/tests/test_zopedatabaseadapter.py Tue Dec 24 21:20:44 2002
@@ -34,7 +34,7 @@
def setUp(self):
self._da = DAStub('dbi://test')
-
+
def testSetGetDSN(self):
da = self._da
da.setDSN('dbi://foo')
=== Zope3/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py:1.1.2.1 Mon Dec 23 14:32:13 2002
+++ Zope3/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py Tue Dec 24 21:20:44 2002
@@ -48,4 +48,3 @@
if __name__=='__main__':
main(defaultTest='test_suite')
-