[Zodb-checkins] CVS: Zope3/src/ZODB/tests - testCache.py:1.21 testConnection.py:1.8

Jeremy Hylton jeremy at zope.com
Sat Mar 13 02:48:43 EST 2004


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

Modified Files:
	testCache.py testConnection.py 
Log Message:
Revise Connection.

Make _added_during_commit a regular instance variable.  Don't use
try/finally to reset it; just clear it at the start of a transaction.
XXX There was a test that needed to be removed, but it seemed to be
just a shallow test that try/finally was used.  Can't see any feature
that depends on specific of error handling: The txn is going to abort.

Remove unused _opened instance variable.
Split commit() into two smaller parts.
Get rid of extra manipulation of _creating.
Don't look for _p_serial of None; z64 is now required.
Undo local variable aliases in subtransaction methods.

Also, trivial change to pickle cache API -- get() works like dict get().


=== Zope3/src/ZODB/tests/testCache.py 1.20 => 1.21 ===
--- Zope3/src/ZODB/tests/testCache.py:1.20	Mon Mar  1 21:53:59 2004
+++ Zope3/src/ZODB/tests/testCache.py	Sat Mar 13 02:48:11 2004
@@ -250,7 +250,7 @@
         self.cache = PickleCache(self.jar)
 
     def checkGetBogusKey(self):
-        self.assertRaises(KeyError, self.cache.get, p64(0))
+        self.assertEqual(self.cache.get(p64(0)), None)
         try:
             self.cache[12]
         except KeyError:


=== Zope3/src/ZODB/tests/testConnection.py 1.7 => 1.8 ===
--- Zope3/src/ZODB/tests/testConnection.py:1.7	Thu Mar  4 17:41:51 2004
+++ Zope3/src/ZODB/tests/testConnection.py	Sat Mar 13 02:48:11 2004
@@ -124,16 +124,6 @@
                 "subobject was not stored")
         self.assert_(self.datamgr._added_during_commit is None)
 
-    def checkErrorDuringCommit(self):
-        # We need to check that _added_during_commit still gets set to None
-        # when there is an error during commit()/
-        obj = ErrorOnGetstateObject()
-        
-        self.datamgr.tpc_begin(self.transaction)
-        self.assertRaises(ErrorOnGetstateException,
-                self.datamgr.commit, obj, self.transaction)
-        self.assert_(self.datamgr._added_during_commit is None)
-
     def checkUnusedAddWorks(self):
         # When an object is added, but not committed, it shouldn't be stored,
         # but also it should be an error.




More information about the Zodb-checkins mailing list