[Checkins] SVN: transaction/branches/sphinx/ Coverage for TransactionManager.{commit, abort}.

Tres Seaver cvs-admin at zope.org
Mon Dec 17 22:09:12 UTC 2012


Log message for revision 128722:
  Coverage for TransactionManager.{commit,abort}.

Changed:
  _U  transaction/branches/sphinx/
  U   transaction/branches/sphinx/transaction/tests/test__manager.py

-=-
Modified: transaction/branches/sphinx/transaction/tests/test__manager.py
===================================================================
--- transaction/branches/sphinx/transaction/tests/test__manager.py	2012-12-17 22:09:09 UTC (rev 128721)
+++ transaction/branches/sphinx/transaction/tests/test__manager.py	2012-12-17 22:09:11 UTC (rev 128722)
@@ -137,6 +137,26 @@
         self.assertTrue(txn.isDoomed())
         self.assertTrue(tm.isDoomed())
 
+    def test_commit_w_existing_txn(self):
+        class Existing(object):
+            _committed = False
+            def commit(self):
+                self._committed = True
+        tm = self._makeOne()
+        tm._txn = txn = Existing()
+        tm.commit()
+        self.assertTrue(txn._committed)
+
+    def test_abort_w_existing_txn(self):
+        class Existing(object):
+            _aborted = False
+            def abort(self):
+                self._aborted = True
+        tm = self._makeOne()
+        tm._txn = txn = Existing()
+        tm.abort()
+        self.assertTrue(txn._aborted)
+
     # basic tests with two sub trans jars
     # really we only need one, so tests for
     # sub1 should identical to tests for sub2



More information about the checkins mailing list