[Zodb-checkins] CVS: ZODB3/ZODB/tests - testZODB.py:1.15
Jeremy Hylton
jeremy at zope.com
Thu May 8 19:43:31 EDT 2003
Update of /cvs-repository/ZODB3/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv21562/tests
Modified Files:
testZODB.py
Log Message:
Fix checkReadConflict() and enable it.
=== ZODB3/ZODB/tests/testZODB.py 1.14 => 1.15 ===
--- ZODB3/ZODB/tests/testZODB.py:1.14 Wed Apr 23 16:33:48 2003
+++ ZODB3/ZODB/tests/testZODB.py Thu May 8 18:43:30 2003
@@ -18,7 +18,7 @@
import ZODB
import ZODB.FileStorage
from ZODB.PersistentMapping import PersistentMapping
-from ZODB.POSException import ReadConflictError
+from ZODB.POSException import ReadConflictError, ConflictError
from ZODB.tests.StorageTestBase import removefs
from Persistence import Persistent
@@ -229,17 +229,17 @@
obj.child1
cn2.getTransaction().abort()
- def testReadConflictIgnored(self):
+ def checkReadConflictIgnored(self):
# Test that an application that catches a read conflict and
# continues can not commit the transaction later.
root = self._db.open().root()
- root["real_data"] = real_data = PersistentDict()
- root["index"] = index = PersistentDict()
+ root["real_data"] = real_data = PersistentMapping()
+ root["index"] = index = PersistentMapping()
- real_data["a"] = PersistentDict({"indexed_value": 0})
- real_data["b"] = PersistentDict({"indexed_value": 1})
- index[1] = PersistentDict({"b": 1})
- index[0] = PersistentDict({"a": 1})
+ real_data["a"] = PersistentMapping({"indexed_value": 0})
+ real_data["b"] = PersistentMapping({"indexed_value": 1})
+ index[1] = PersistentMapping({"b": 1})
+ index[0] = PersistentMapping({"a": 1})
get_transaction().commit()
# load some objects from one connection
@@ -252,7 +252,7 @@
real_data["b"]["indexed_value"] = 0
del index[1]["b"]
index[0]["b"] = 1
- cn2.getTransaction().commit()
+ get_transaction().commit()
del real_data2["a"]
try:
@@ -271,7 +271,7 @@
self.assert_(not index2[0]._p_changed)
self.assert_(not index2[1]._p_changed)
- self.assertRaises(ConflictError, get_transaction().commit)
+ self.assertRaises(ConflictError, cn2.getTransaction().commit)
get_transaction().abort()
def checkIndependent(self):
More information about the Zodb-checkins
mailing list