[Zodb-checkins] CVS: ZODB3/ZODB/tests - testTransaction.py:1.17.2.1
Jim Fulton
jim at zope.com
Fri Jan 23 10:07:36 EST 2004
Update of /cvs-repository/ZODB3/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv2903
Modified Files:
Tag: zope3-zodb3-devel-branch
testTransaction.py
Log Message:
Added test for the transaction join method.
=== ZODB3/ZODB/tests/testTransaction.py 1.17 => 1.17.2.1 ===
--- ZODB3/ZODB/tests/testTransaction.py:1.17 Wed Dec 24 11:01:58 2003
+++ ZODB3/ZODB/tests/testTransaction.py Fri Jan 23 10:07:35 2004
@@ -628,9 +628,39 @@
HoserJar.committed += 1
+def test_join():
+ """White-boc test of the join method
+
+ The join method is provided for "backward-compatability" with ZODB 4
+ data managers.
+
+ The argument to join must be a zodb4 data manager,
+ transaction.interfaces.IDataManager.
+
+ >>> from transaction.tests.test_SampleDataManager import DataManager
+ >>> from ZODB.Transaction import DataManagerAdapter
+ >>> t = Transaction.Transaction()
+ >>> dm = DataManager()
+ >>> t.join(dm)
+
+ The end result is that a data manager adapter is one of the
+ transaction's objects:
+
+ >>> isinstance(t._objects[0], DataManagerAdapter)
+ True
+ >>> t._objects[0]._datamanager is dm
+ True
+
+ """
+
def test_suite():
+ from doctest import DocTestSuite
+ return unittest.TestSuite((
+ DocTestSuite(),
+ unittest.makeSuite(TransactionTests),
+ ))
- return unittest.makeSuite(TransactionTests)
if __name__ == '__main__':
unittest.TextTestRunner().run(test_suite())
+
More information about the Zodb-checkins
mailing list