[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/rdb/ Added test to make sure that ZopeDBTransactionManager implements IDataManager

Dmitry Vasiliev dima at hlabs.spb.ru
Fri Aug 12 05:54:11 EDT 2005


Log message for revision 37883:
  Added test to make sure that ZopeDBTransactionManager implements IDataManager
  

Changed:
  U   Zope3/trunk/src/zope/app/rdb/__init__.py
  U   Zope3/trunk/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py

-=-
Modified: Zope3/trunk/src/zope/app/rdb/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/rdb/__init__.py	2005-08-11 21:53:00 UTC (rev 37882)
+++ Zope3/trunk/src/zope/app/rdb/__init__.py	2005-08-12 09:54:11 UTC (rev 37883)
@@ -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/trunk/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py
===================================================================
--- Zope3/trunk/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py	2005-08-11 21:53:00 UTC (rev 37882)
+++ Zope3/trunk/src/zope/app/rdb/tests/test_zopedbtransactionmanager.py	2005-08-12 09:54:11 UTC (rev 37883)
@@ -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