[Zope3-checkins] CVS: Zope3/src/transaction/tests - test_txn.py:1.4

Jeremy Hylton jeremy@zope.com
Thu, 20 Mar 2003 12:26:25 -0500


Update of /cvs-repository/Zope3/src/transaction/tests
In directory cvs.zope.org:/tmp/cvs-serv14445/tests

Modified Files:
	test_txn.py 
Log Message:
Change prepare() signature in IDataManager.

The manager should raise an exception in its prepare() method rather
than returning a boolean to indicate failure.  Rationale: The txn
manager can't raise a reasonable exception, because it doesn't know
what the data manager couldn't prepare.


=== Zope3/src/transaction/tests/test_txn.py 1.3 => 1.4 ===
--- Zope3/src/transaction/tests/test_txn.py:1.3	Mon Mar 10 14:14:40 2003
+++ Zope3/src/transaction/tests/test_txn.py	Thu Mar 20 12:25:54 2003
@@ -33,7 +33,6 @@
     def prepare(self, txn):
         if self._fail == "prepare":
             raise RuntimeError
-        return self._vote
 
     def abort(self, txn):
         if self._fail == "abort":
@@ -124,15 +123,6 @@
         txn.join(TestDataManager(fail="prepare"))
         self.assertRaises(RuntimeError, txn.commit)
         self.assertEqual(txn.status(), Status.FAILED)
-        txn.abort()
-
-    def testCommitPrepareFalse(self):
-        txn = self.manager.begin()
-        txn.join(TestDataManager())
-        txn.join(TestDataManager(vote=False))
-        self.assertRaises(AbortError, txn.commit)
-        self.assertEqual(txn.status(), Status.FAILED)
-        self.assertRaises(IllegalStateError, txn.commit)
         txn.abort()
 
     def testCommitFailure(self):