[Zope3-checkins] SVN: Zope3/branches/Zope-3.1/src/zope/app/rdb/ Merged revision 37883 from the trunk:

Dmitry Vasiliev dima at hlabs.spb.ru
Fri Aug 12 06:27:33 EDT 2005


Log message for revision 37884:
  Merged revision 37883 from the trunk:
  
  Added test to make sure that ZopeDBTransactionManager implements IDataManager
  

Changed:
  U   Zope3/branches/Zope-3.1/src/zope/app/rdb/__init__.py
  U   Zope3/branches/Zope-3.1/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py

-=-
Modified: Zope3/branches/Zope-3.1/src/zope/app/rdb/__init__.py
===================================================================
--- Zope3/branches/Zope-3.1/src/zope/app/rdb/__init__.py	2005-08-12 09:54:11 UTC (rev 37883)
+++ Zope3/branches/Zope-3.1/src/zope/app/rdb/__init__.py	2005-08-12 10:27:33 UTC (rev 37884)
@@ -407,10 +407,23 @@
 
     def __init__(self, dbconn):
         self._dbconn = dbconn
+        self.transaction_manager = transaction.manager
 
     def prepare(self, txn):
         pass
 
+    def tpc_begin(self, txn):
+        pass
+
+    def tpc_vote(self, txn):
+        pass
+
+    def tpc_finish(self, txn):
+        pass
+
+    def tpc_abort(self, txn):
+        pass
+
     def abort(self, txn):
         self._dbconn.rollback()
 

Modified: Zope3/branches/Zope-3.1/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py
===================================================================
--- Zope3/branches/Zope-3.1/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py	2005-08-12 09:54:11 UTC (rev 37883)
+++ Zope3/branches/Zope-3.1/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py	2005-08-12 10:27:33 UTC (rev 37884)
@@ -17,11 +17,15 @@
 """
 from unittest import TestCase, main, makeSuite, TestSuite
 import transaction
+from transaction.interfaces import IDataManager
 from transaction.tests.abstestIDataManager import IDataManagerTests
+
+from zope.interface.verify import verifyObject
 from zope.app.rdb import ZopeDBTransactionManager
 from zope.app.rdb import ZopeConnection
 from zope.app.rdb.tests.stubs import ConnectionStub, TypeInfoStub
 
+
 class TxnMgrTest(IDataManagerTests, TestCase):
 
     def setUp(self):
@@ -35,6 +39,9 @@
         """ make sure the global env is clean"""
         transaction.abort()
 
+    def test_interface(self):
+        self.assert_(verifyObject(IDataManager, self.datamgr))
+
     def test_abort(self):
         transaction.abort()
         self.assertEqual(self.conn._called.get('rollback'), 1)



More information about the Zope3-Checkins mailing list