[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/RDB/tests - testZopeConnection.py:1.6 testZopeDBTransactionManager.py:1.5

Albertas Agejevas alga@codeworks.lt
Mon, 9 Dec 2002 11:07:29 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/RDB/tests
In directory cvs.zope.org:/tmp/cvs-serv31201/lib/python/Zope/App/RDB/tests

Modified Files:
	testZopeConnection.py testZopeDBTransactionManager.py 
Log Message:
Fixed a bug in transaction management in RDB code.

=== Zope3/lib/python/Zope/App/RDB/tests/testZopeConnection.py 1.5 => 1.6 ===
--- Zope3/lib/python/Zope/App/RDB/tests/testZopeConnection.py:1.5	Mon Aug 12 11:07:30 2002
+++ Zope3/lib/python/Zope/App/RDB/tests/testZopeConnection.py	Mon Dec  9 11:07:28 2002
@@ -19,7 +19,7 @@
 from Transaction import get_transaction
 from Zope.App.RDB.ZopeConnection import ZopeConnection
 from Zope.App.RDB.IZopeCursor import IZopeCursor
-from Stubs import *
+from Stubs import ConnectionStub, TypeInfoStub
 
 class ZopeConnectionTests(TestCase):
 
@@ -40,6 +40,24 @@
 
         self.assertEqual(zc._txn_registered, True)
         self.assertEqual(len(t._resources), 1)
+
+    def test_commit(self):
+        t = get_transaction()
+        t.begin()
+        zc = ZopeConnection(ConnectionStub(), TypeInfoStub())
+        self._txn_registered = True
+        zc.commit()
+        self.assertEqual(zc._txn_registered, False,
+                         "did not forget the transaction")
+
+    def test_rollback(self):
+        t = get_transaction()
+        t.begin()
+        zc = ZopeConnection(ConnectionStub(), TypeInfoStub())
+        self._txn_registered = True
+        zc.rollback()
+        self.assertEqual(zc._txn_registered, False,
+                         "did not forget the transaction")
 
     def test_getattr(self):
         zc = ZopeConnection(ConnectionStub(), TypeInfoStub())


=== Zope3/lib/python/Zope/App/RDB/tests/testZopeDBTransactionManager.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/App/RDB/tests/testZopeDBTransactionManager.py:1.4	Mon Aug 12 11:07:30 2002
+++ Zope3/lib/python/Zope/App/RDB/tests/testZopeDBTransactionManager.py	Mon Dec  9 11:07:28 2002
@@ -20,7 +20,7 @@
 from Transaction.tests.abstestIDataManager import IDataManagerTests
 from Zope.App.RDB.ZopeDBTransactionManager import ZopeDBTransactionManager
 from Zope.App.RDB.ZopeConnection import ZopeConnection
-from Stubs import *
+from Stubs import ConnectionStub, CursorStub, TypeInfoStub
 
 class TxnMgrTest(IDataManagerTests, TestCase):