[Zope3-checkins] CVS: Zope3/lib/python/ZODB/tests - TransactionalUndoStorage.py:1.24

Jeremy Hylton jeremy@zope.com
Thu, 25 Jul 2002 17:32:11 -0400


Update of /cvs-repository/Zope3/lib/python/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv22988/ZODB/tests

Modified Files:
	TransactionalUndoStorage.py 
Log Message:
Rationalize use of UndoError().


=== Zope3/lib/python/ZODB/tests/TransactionalUndoStorage.py 1.23 => 1.24 ===
         tid = info[1]['id']
         t = Transaction()
         self._storage.tpc_begin(t)
-        self.assertRaises(POSException.UndoError,
-                          self._storage.transactionalUndo,
-                          tid, t)
+        try:
+            self._storage.transactionalUndo(tid, t)
+        except POSException.UndoError, e:
+            s = str(e)
+        else:
+            self.fail("UndoError expected")
         self._storage.tpc_abort(t)
         # Now have more fun: object1 and object2 are in the same transaction,
         # which we'll try to undo to, but one of them has since modified in
@@ -430,7 +433,10 @@
         tid = info[1]['id']
         t = Transaction()
         self._storage.tpc_begin(t)
-        self.assertRaises(POSException.UndoError,
-                          self._storage.transactionalUndo,
-                          tid, t)
+        try:
+            self._storage.transactionalUndo(tid, t)
+        except POSException.UndoError, e:
+            s = str(e)
+        else:
+            self.fail("UndoError expected")
         self._storage.tpc_abort(t)