[Zope-Checkins] CVS: ZODB3/ZODB/tests - testZODB.py:1.16.2.2
testUtils.py:1.4.2.1 testTransaction.py:1.13.2.1
testTimeStamp.py:1.5.2.1 testRecover.py:1.4.2.3
testPersistentMapping.py:1.6.2.1
testPersistentList.py:1.4.2.1 testFileStorage.py:1.34.2.6
testCache.py:1.15.2.1 speed.py:1.4.114.1 dangle.py:1.2.2.1
VersionStorage.py:1.25.2.12
TransactionalUndoVersionStorage.py:1.12.2.5
TransactionalUndoStorage.py:1.33.2.5
StorageTestBase.py:1.29.2.5 ReadOnlyStorage.py:1.7.2.2
PackableStorage.py:1.22.2.3 MinPO.py:1.4.2.1
MTStorage.py:1.11.2.2 HistoryStorage.py:1.11.2.2
ConflictResolution.py:1.11.2.1 BasicStorage.py:1.26.2.2
Jeremy Hylton
jeremy at zope.com
Tue Dec 23 14:06:53 EST 2003
Update of /cvs-repository/ZODB3/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv26665/ZODB/tests
Modified Files:
Tag: ZODB3-mvcc-2-branch
testZODB.py testUtils.py testTransaction.py testTimeStamp.py
testRecover.py testPersistentMapping.py testPersistentList.py
testFileStorage.py testCache.py speed.py dangle.py
VersionStorage.py TransactionalUndoVersionStorage.py
TransactionalUndoStorage.py StorageTestBase.py
ReadOnlyStorage.py PackableStorage.py MinPO.py MTStorage.py
HistoryStorage.py ConflictResolution.py BasicStorage.py
Log Message:
Merge the head to the mvcc branch.
This merge should be the final preparation for merging the branch to
the trunk.
=== ZODB3/ZODB/tests/testZODB.py 1.16.2.1 => 1.16.2.2 ===
--- ZODB3/ZODB/tests/testZODB.py:1.16.2.1 Wed Nov 12 00:44:47 2003
+++ ZODB3/ZODB/tests/testZODB.py Tue Dec 23 14:05:50 2003
@@ -11,15 +11,13 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-from __future__ import nested_scopes
-
import unittest
import ZODB
import ZODB.FileStorage
-from ZODB.PersistentMapping import PersistentMapping
from ZODB.POSException import ReadConflictError, ConflictError
-from Persistence import Persistent
+from persistent import Persistent
+from persistent.mapping import PersistentMapping
class P(Persistent):
pass
@@ -140,6 +138,9 @@
def checkResetCache(self):
# The cache size after a reset should be 0 and the GC attributes
# ought to be linked to it rather than the old cache.
+ # Note that _resetCache is not a public API, but the
+ # resetCaches() function is, and resetCaches() causes
+ # _resetCache() to be called.
self.populate()
conn = self._db.open()
conn.root()
@@ -149,6 +150,19 @@
self.assert_(conn._incrgc == conn._cache.incrgc)
self.assert_(conn.cacheGC == conn._cache.incrgc)
+ def checkResetCachesAPI(self):
+ # Checks the resetCaches() API.
+ # (resetCaches used to be called updateCodeTimestamp.)
+ self.populate()
+ conn = self._db.open()
+ conn.root()
+ self.assert_(len(conn._cache) > 0) # Precondition
+ ZODB.Connection.resetCaches()
+ conn.close()
+ self.assert_(len(conn._cache) > 0) # Still not flushed
+ conn._setDB(self._db) # simulate the connection being reopened
+ self.assertEqual(len(conn._cache), 0)
+
def checkLocalTransactions(self):
# Test of transactions that apply to only the connection,
# not the thread.
@@ -283,3 +297,7 @@
def test_suite():
return unittest.makeSuite(ZODBTests, 'check')
+
+if __name__ == "__main__":
+ unittest.main(defaultTest="test_suite")
+
=== ZODB3/ZODB/tests/testUtils.py 1.4 => 1.4.2.1 ===
--- ZODB3/ZODB/tests/testUtils.py:1.4 Thu Oct 2 14:17:17 2003
+++ ZODB3/ZODB/tests/testUtils.py Tue Dec 23 14:05:50 2003
@@ -15,6 +15,8 @@
import random
import unittest
+from persistent import Persistent
+import ZODB.coptimizations
NUM = 100
@@ -43,6 +45,13 @@
self.assertEquals(U64("\000\000\000\000\000\000\000\001"), 1)
self.assertEquals(u64("\000\000\000\001\000\000\000\000"), 1L<<32)
self.assertEquals(U64("\000\000\000\001\000\000\000\000"), 1L<<32)
+
+ def checkPersistentIdHandlesDescriptor(self):
+ class P(Persistent):
+ pass
+ L = []
+ pid = ZODB.coptimizations.new_persistent_id(None, L)
+ pid(P)
def test_suite():
return unittest.makeSuite(TestUtils, 'check')
=== ZODB3/ZODB/tests/testTransaction.py 1.13 => 1.13.2.1 ===
--- ZODB3/ZODB/tests/testTransaction.py:1.13 Thu Oct 2 14:17:17 2003
+++ ZODB3/ZODB/tests/testTransaction.py Tue Dec 23 14:05:50 2003
@@ -86,6 +86,17 @@
assert self.sub2._p_jar.cabort == 1
+ def testTransactionNote(self):
+
+ t = get_transaction()
+
+ t.note('This is a note.')
+ self.assertEqual(t.description, 'This is a note.')
+ t.note('Another.')
+ self.assertEqual(t.description, 'This is a note.\n\nAnother.')
+
+ t.abort()
+
def testSubTransactionCommitCommit(self):
self.sub1.modify()
@@ -510,7 +521,7 @@
except Transaction.POSException.TransactionError:
pass
else:
- raise "Hosed Application didn't stop commits"
+ self.fail("Hosed Application didn't stop commits")
class DataObject:
=== ZODB3/ZODB/tests/testTimeStamp.py 1.5 => 1.5.2.1 ===
--- ZODB3/ZODB/tests/testTimeStamp.py:1.5 Thu Oct 2 14:17:17 2003
+++ ZODB3/ZODB/tests/testTimeStamp.py Tue Dec 23 14:05:50 2003
@@ -16,7 +16,7 @@
import time
import unittest
-from ZODB.TimeStamp import TimeStamp
+from persistent.TimeStamp import TimeStamp
EPSILON = 0.000001
@@ -106,7 +106,6 @@
self.assertEquals(t.hour(), 10)
self.assertEquals(t.minute(), 48)
self.assertEquals(round(t.second()), 5)
- self.assertEquals(t.second(), t.seconds()) # Alias
self.assertEquals(t.timeTime(), 1011782885)
t1 = TimeStamp(2002, 1, 23, 10, 48, 10)
self.assertEquals(str(t1), '2002-01-23 10:48:10.000000')
=== ZODB3/ZODB/tests/testRecover.py 1.4.2.2 => 1.4.2.3 ===
--- ZODB3/ZODB/tests/testRecover.py:1.4.2.2 Wed Nov 12 00:44:47 2003
+++ ZODB3/ZODB/tests/testRecover.py Tue Dec 23 14:05:50 2003
@@ -23,10 +23,9 @@
import ZODB
from ZODB.FileStorage import FileStorage
-from ZODB.PersistentMapping import PersistentMapping
from ZODB.fsrecover import recover
-from ZODB.FileStorage.fsdump import Dumper
+from persistent.mapping import PersistentMapping
class RecoverTest(unittest.TestCase):
=== ZODB3/ZODB/tests/testPersistentMapping.py 1.6 => 1.6.2.1 ===
--- ZODB3/ZODB/tests/testPersistentMapping.py:1.6 Thu Oct 2 14:17:17 2003
+++ ZODB3/ZODB/tests/testPersistentMapping.py Tue Dec 23 14:05:50 2003
@@ -58,7 +58,7 @@
r = db.open().root()
r[1] = 1
r[2] = 2
-## r[3] = r
+ r[3] = r
get_transaction().commit()
# MappingStorage stores serialno + pickle in its _index.
root_pickle = s._index['\000' * 8][8:]
@@ -67,7 +67,7 @@
u = cPickle.Unpickler(f)
klass_info = u.load()
klass = find_global(*klass_info[0])
- inst = klass()
+ inst = klass.__new__(klass)
state = u.load()
inst.__setstate__(state)
@@ -78,7 +78,7 @@
"""Helper for this test suite to get special PersistentMapping"""
if classname == "PersistentMapping":
- class PersistentMapping:
+ class PersistentMapping(object):
def __setstate__(self, state):
self.__dict__.update(state)
return PersistentMapping
@@ -88,9 +88,8 @@
return getattr(mod, classname)
def test_suite():
+ return None
return unittest.makeSuite(PMTests, 'check')
if __name__ == "__main__":
- loader = unittest.TestLoader()
- loader.testMethodPrefix = "check"
- unittest.main(testLoader=loader)
+ unittest.main()
=== ZODB3/ZODB/tests/testPersistentList.py 1.4 => 1.4.2.1 ===
--- ZODB3/ZODB/tests/testPersistentList.py:1.4 Thu Oct 2 14:17:17 2003
+++ ZODB3/ZODB/tests/testPersistentList.py Tue Dec 23 14:05:50 2003
@@ -15,7 +15,7 @@
"""
import unittest
-from ZODB.PersistentList import PersistentList
+from persistent.list import PersistentList
l0 = []
l1 = [0]
=== ZODB3/ZODB/tests/testFileStorage.py 1.34.2.5 => 1.34.2.6 ===
--- ZODB3/ZODB/tests/testFileStorage.py:1.34.2.5 Tue Dec 2 02:10:32 2003
+++ ZODB3/ZODB/tests/testFileStorage.py Tue Dec 23 14:05:50 2003
@@ -11,8 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-from __future__ import nested_scopes
-
import ZODB.FileStorage
import sys, os, unittest
import errno
=== ZODB3/ZODB/tests/testCache.py 1.15 => 1.15.2.1 ===
--- ZODB3/ZODB/tests/testCache.py:1.15 Thu Oct 2 14:17:17 2003
+++ ZODB3/ZODB/tests/testCache.py Tue Dec 23 14:05:50 2003
@@ -17,7 +17,6 @@
purposes. It acts like a memo for unpickling. It also keeps recent
objects in memory under the assumption that they may be used again.
"""
-from __future__ import nested_scopes
import time
import types
@@ -25,13 +24,13 @@
import ZODB
import ZODB.MappingStorage
-from ZODB.cPickleCache import PickleCache
from ZODB.POSException import ConflictError
-from ZODB.PersistentMapping import PersistentMapping
+from persistent.cPickleCache import PickleCache
+from persistent.mapping import PersistentMapping
from ZODB.tests.MinPO import MinPO
from ZODB.utils import p64
-from Persistence import Persistent
+from persistent import Persistent
class CacheTestBase(unittest.TestCase):
=== ZODB3/ZODB/tests/speed.py 1.4 => 1.4.114.1 ===
--- ZODB3/ZODB/tests/speed.py:1.4 Wed Aug 14 18:07:09 2002
+++ ZODB3/ZODB/tests/speed.py Tue Dec 23 14:05:50 2003
@@ -39,9 +39,9 @@
sys.path.insert(0, os.getcwd())
import ZODB, ZODB.FileStorage
-import Persistence
+import persistent
-class P(Persistence.Persistent): pass
+class P(persistent.Persistent): pass
def main(args):
=== ZODB3/ZODB/tests/dangle.py 1.2 => 1.2.2.1 ===
--- ZODB3/ZODB/tests/dangle.py:1.2 Thu Oct 2 14:17:17 2003
+++ ZODB3/ZODB/tests/dangle.py Tue Dec 23 14:05:50 2003
@@ -21,7 +21,7 @@
from ZODB.FileStorage import FileStorage
from ZODB import DB
-from Persistence import Persistent
+from persistent import Persistent
class P(Persistent):
pass
=== ZODB3/ZODB/tests/VersionStorage.py 1.25.2.11 => 1.25.2.12 ===
--- ZODB3/ZODB/tests/VersionStorage.py:1.25.2.11 Fri Dec 19 17:49:13 2003
+++ ZODB3/ZODB/tests/VersionStorage.py Tue Dec 23 14:05:50 2003
@@ -170,7 +170,7 @@
oid = self._storage.new_oid()
revid = self._dostore(oid, data=MinPO(49))
revid = self._dostore(oid, revid=revid, data=MinPO(50))
- nvrevid = revid = self._dostore(oid, revid=revid, data=MinPO(51))
+ revid = self._dostore(oid, revid=revid, data=MinPO(51))
# Now do some stores in a version
revid = self._dostore(oid, revid=revid, data=MinPO(52),
version=version)
@@ -254,7 +254,6 @@
self._storage.tpc_abort(t)
def checkNewSerialOnCommitVersionToVersion(self):
- eq = self.assertEqual
oid, version = self._setup_version()
data, vtid = self._storage.load(oid, version)
data, ntid = self._storage.load(oid, '')
@@ -500,7 +499,6 @@
self._storage.pack(time.time(), referencesf)
cn.sync()
- cn._cache.clear()
# make sure all the non-version data is there
for name, obj in root.items():
=== ZODB3/ZODB/tests/TransactionalUndoVersionStorage.py 1.12.2.4 => 1.12.2.5 ===
--- ZODB3/ZODB/tests/TransactionalUndoVersionStorage.py:1.12.2.4 Tue Dec 2 02:10:32 2003
+++ ZODB3/ZODB/tests/TransactionalUndoVersionStorage.py Tue Dec 23 14:05:50 2003
@@ -11,8 +11,6 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-from __future__ import nested_scopes
-
# Check interactions between transactionalUndo() and versions. Any storage
# that supports both transactionalUndo() and versions must pass these tests.
@@ -112,9 +110,9 @@
version = 'version'
revid1 = self._x_dostore(oid1, data=MinPO(0), description='create1')
revid2 = self._x_dostore(oid1, data=MinPO(1), revid=revid1,
- version=version, description='version1')
- revid3 = self._x_dostore(oid1, data=MinPO(2), revid=revid2,
- version=version, description='version2')
+ version=version, description='version1')
+ self._x_dostore(oid1, data=MinPO(2), revid=revid2,
+ version=version, description='version2')
self._x_dostore(description='create2')
t = Transaction()
@@ -167,9 +165,9 @@
version = 'version'
revid1 = self._x_dostore(oid1, data=MinPO(0), description='create1')
revid2 = self._x_dostore(oid1, data=MinPO(1), revid=revid1,
- version=version, description='version1')
- revid3 = self._x_dostore(oid1, data=MinPO(2), revid=revid2,
- version=version, description='version2')
+ version=version, description='version1')
+ self._x_dostore(oid1, data=MinPO(2), revid=revid2,
+ version=version, description='version2')
self._x_dostore(description='create2')
self._abortVersion(version)
=== ZODB3/ZODB/tests/TransactionalUndoStorage.py 1.33.2.4 => 1.33.2.5 ===
--- ZODB3/ZODB/tests/TransactionalUndoStorage.py:1.33.2.4 Tue Dec 2 02:10:32 2003
+++ ZODB3/ZODB/tests/TransactionalUndoStorage.py Tue Dec 23 14:05:50 2003
@@ -15,7 +15,6 @@
Any storage that supports transactionalUndo() must pass these tests.
"""
-from __future__ import nested_scopes
import time
import types
@@ -25,7 +24,7 @@
from ZODB.utils import u64, p64
from ZODB import DB
-from Persistence import Persistent
+from persistent import Persistent
from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import zodb_pickle, zodb_unpickle
@@ -99,6 +98,15 @@
for rec in txn:
pass
+ def undo(self, tid, note):
+ t = Transaction()
+ t.note(note)
+ self._storage.tpc_begin(t)
+ oids = self._storage.transactionalUndo(tid, t)
+ self._storage.tpc_vote(t)
+ self._storage.tpc_finish(t)
+ return oids
+
def checkSimpleTransactionalUndo(self):
eq = self.assertEqual
oid = self._storage.new_oid()
@@ -132,6 +140,23 @@
eq(zodb_unpickle(data), MinPO(23))
self._iterate()
+ def checkCreationUndoneGetSerial(self):
+ # create an object
+ oid = self._storage.new_oid()
+ self._dostore(oid, data=MinPO(23))
+ # undo its creation
+ info = self._storage.undoInfo()
+ tid = info[0]['id']
+ t = Transaction()
+ t.note('undo1')
+ self._storage.tpc_begin(t)
+ self._storage.transactionalUndo(tid, t)
+ self._storage.tpc_vote(t)
+ self._storage.tpc_finish(t)
+ # Check that calling getSerial on an uncreated object raises a KeyError
+ # The current version of FileStorage fails this test
+ self.assertRaises(KeyError, self._storage.getSerial, oid)
+
def checkUndoCreationBranch1(self):
eq = self.assertEqual
oid = self._storage.new_oid()
@@ -406,7 +431,7 @@
packtime = time.time()
snooze() # time.time() now distinct from packtime
revid2 = self._dostore(oid, revid=revid1, data=MinPO(52))
- revid3 = self._dostore(oid, revid=revid2, data=MinPO(53))
+ self._dostore(oid, revid=revid2, data=MinPO(53))
# Now get the undo log
info = self._storage.undoInfo()
eq(len(info), 3)
@@ -574,7 +599,10 @@
for t in packtimes:
self._storage.pack(t, referencesf)
cn.sync()
- cn._cache.clear()
+
+ # XXX Is _cache supposed to have a clear() method, or not?
+ # cn._cache.clear()
+
# The last undo set the value to 3 and pack should
# never change that.
self.assertEqual(rt["test"].value, 3)
=== ZODB3/ZODB/tests/StorageTestBase.py 1.29.2.4 => 1.29.2.5 ===
--- ZODB3/ZODB/tests/StorageTestBase.py:1.29.2.4 Tue Dec 2 02:10:32 2003
+++ ZODB3/ZODB/tests/StorageTestBase.py Tue Dec 23 14:05:50 2003
@@ -42,11 +42,18 @@
while now == time.time():
time.sleep(0.1)
+def _persistent_id(obj):
+ oid = getattr(obj, "_p_oid", None)
+ if getattr(oid, "__get__", None) is not None:
+ return None
+ else:
+ return oid
+
def zodb_pickle(obj):
"""Create a pickle in the format expected by ZODB."""
f = StringIO()
p = Pickler(f, 1)
- p.persistent_id = lambda obj: getattr(obj, '_p_oid', None)
+ p.persistent_id = _persistent_id
klass = obj.__class__
assert not hasattr(obj, '__getinitargs__'), "not ready for constructors"
args = None
=== ZODB3/ZODB/tests/ReadOnlyStorage.py 1.7.2.1 => 1.7.2.2 ===
--- ZODB3/ZODB/tests/ReadOnlyStorage.py:1.7.2.1 Mon Nov 24 13:33:36 2003
+++ ZODB3/ZODB/tests/ReadOnlyStorage.py Tue Dec 23 14:05:50 2003
@@ -26,7 +26,7 @@
def _make_readonly(self):
self._storage.close()
- self.open(read_only=1)
+ self.open(read_only=True)
self.assert_(self._storage.isReadOnly())
def checkReadMethods(self):
=== ZODB3/ZODB/tests/PackableStorage.py 1.22.2.2 => 1.22.2.3 ===
--- ZODB3/ZODB/tests/PackableStorage.py:1.22.2.2 Mon Dec 1 10:16:11 2003
+++ ZODB3/ZODB/tests/PackableStorage.py Tue Dec 23 14:05:50 2003
@@ -29,7 +29,7 @@
import time
from ZODB import DB
-from Persistence import Persistent
+from persistent import Persistent
from ZODB.referencesf import referencesf
from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import snooze
@@ -125,11 +125,11 @@
try:
self._storage.load(ZERO, '')
except KeyError:
- import PersistentMapping
+ from persistent import mapping
from ZODB.Transaction import Transaction
file = StringIO()
p = cPickle.Pickler(file, 1)
- p.dump((PersistentMapping.PersistentMapping, None))
+ p.dump((mapping.PersistentMapping, None))
p.dump({'_container': {}})
t=Transaction()
t.description='initial database creation'
@@ -168,12 +168,13 @@
snooze()
packt = time.time()
- for j in range(10):
- for i in range(10):
+ choices = range(10)
+ for dummy in choices:
+ for i in choices:
root[i].value = MinPO(i)
get_transaction().commit()
- threads = [ClientThread(db) for i in range(4)]
+ threads = [ClientThread(db, choices) for i in range(4)]
for t in threads:
t.start()
@@ -438,8 +439,6 @@
def checkPackUndoLog(self):
self._initroot()
- eq = self.assertEqual
- raises = self.assertRaises
# Create a `persistent' object
obj = self._newobj()
oid = obj.getoid()
@@ -450,9 +449,9 @@
snooze()
packtime = time.time()
snooze()
- revid2 = self._dostoreNP(oid, revid=revid1, data=pickle.dumps(obj))
+ self._dostoreNP(oid, revid=revid1, data=pickle.dumps(obj))
# Now pack the first transaction
- self.assertEqual(3,len(self._storage.undoLog()))
+ self.assertEqual(3, len(self._storage.undoLog()))
self._storage.pack(packtime, referencesf)
# The undo log contains only the most resent transaction
self.assertEqual(1,len(self._storage.undoLog()))
@@ -489,12 +488,12 @@
revid13 = self._dostoreNP(oid1, revid=revid11,
data=pickle.dumps(obj1), description="1-3")
obj1.value = 4
- revid14 = self._dostoreNP(oid1, revid=revid13,
- data=pickle.dumps(obj1), description="1-4")
+ self._dostoreNP(oid1, revid=revid13,
+ data=pickle.dumps(obj1), description="1-4")
# Commit one revision of the second object
obj2.value = 5
- revid25 = self._dostoreNP(oid2, revid=revid22,
- data=pickle.dumps(obj2), description="2-5")
+ self._dostoreNP(oid2, revid=revid22,
+ data=pickle.dumps(obj2), description="2-5")
# Now pack
self.assertEqual(6,len(self._storage.undoLog()))
print '\ninitial undoLog was'
@@ -508,14 +507,17 @@
class ClientThread(threading.Thread):
- def __init__(self, db):
+ def __init__(self, db, choices):
threading.Thread.__init__(self)
self.root = db.open().root()
+ self.choices = choices
def run(self):
+ from random import choice
+
for j in range(50):
try:
- self.root[j % 10].value = MinPO(j)
+ self.root[choice(self.choices)].value = MinPO(j)
get_transaction().commit()
except ConflictError:
get_transaction().abort()
=== ZODB3/ZODB/tests/MinPO.py 1.4 => 1.4.2.1 ===
--- ZODB3/ZODB/tests/MinPO.py:1.4 Thu Oct 2 14:17:17 2003
+++ ZODB3/ZODB/tests/MinPO.py Tue Dec 23 14:05:50 2003
@@ -13,7 +13,7 @@
##############################################################################
"""A minimal persistent object to use for tests"""
-from Persistence import Persistent
+from persistent import Persistent
class MinPO(Persistent):
def __init__(self, value=None):
=== ZODB3/ZODB/tests/MTStorage.py 1.11.2.1 => 1.11.2.2 ===
--- ZODB3/ZODB/tests/MTStorage.py:1.11.2.1 Tue Nov 18 12:29:46 2003
+++ ZODB3/ZODB/tests/MTStorage.py Tue Dec 23 14:05:50 2003
@@ -4,7 +4,7 @@
import time
import ZODB
-from PersistentMapping import PersistentMapping
+from persistent.mapping import PersistentMapping
from ZODB.tests.StorageTestBase \
import StorageTestBase, zodb_pickle, zodb_unpickle, handle_serials
=== ZODB3/ZODB/tests/HistoryStorage.py 1.11.2.1 => 1.11.2.2 ===
--- ZODB3/ZODB/tests/HistoryStorage.py:1.11.2.1 Tue Dec 2 02:10:32 2003
+++ ZODB3/ZODB/tests/HistoryStorage.py Tue Dec 23 14:05:50 2003
@@ -132,7 +132,7 @@
# Now commit the version
t = Transaction()
self._storage.tpc_begin(t)
- oids = self._storage.commitVersion(version, '', t)
+ self._storage.commitVersion(version, '', t)
self._storage.tpc_vote(t)
self._storage.tpc_finish(t)
# After consultation with Jim, we agreed that the semantics of
@@ -192,7 +192,7 @@
# Now commit the version
t = Transaction()
self._storage.tpc_begin(t)
- oids = self._storage.abortVersion(version, t)
+ self._storage.abortVersion(version, t)
self._storage.tpc_vote(t)
self._storage.tpc_finish(t)
# After consultation with Jim, we agreed that the semantics of
=== ZODB3/ZODB/tests/ConflictResolution.py 1.11 => 1.11.2.1 ===
--- ZODB3/ZODB/tests/ConflictResolution.py:1.11 Thu Oct 2 14:17:17 2003
+++ ZODB3/ZODB/tests/ConflictResolution.py Tue Dec 23 14:05:50 2003
@@ -15,7 +15,7 @@
from ZODB.Transaction import Transaction
from ZODB.POSException import ConflictError, UndoError
-from Persistence import Persistent
+from persistent import Persistent
from ZODB.tests.StorageTestBase import zodb_unpickle, zodb_pickle
@@ -94,9 +94,12 @@
# pickle is to commit two different transactions relative to
# revid1 that add two to _value.
revid2 = self._dostoreNP(oid, revid=revid1, data=zodb_pickle(obj))
- self.assertRaises(ConflictError,
- self._dostoreNP,
- oid, revid=revid1, data=zodb_pickle(obj))
+ try:
+ self._dostoreNP(oid, revid=revid1, data=zodb_pickle(obj))
+ except ConflictError, err:
+ self.assert_("PCounter2" in str(err))
+ else:
+ self.fail("Expected ConflictError")
def checkZClassesArentResolved(self):
from ZODB.ConflictResolution import bad_class
=== ZODB3/ZODB/tests/BasicStorage.py 1.26.2.1 => 1.26.2.2 ===
--- ZODB3/ZODB/tests/BasicStorage.py:1.26.2.1 Wed Nov 5 01:18:13 2003
+++ ZODB3/ZODB/tests/BasicStorage.py Tue Dec 23 14:05:50 2003
@@ -113,7 +113,7 @@
def checkConflicts(self):
oid = self._storage.new_oid()
revid1 = self._dostore(oid, data=MinPO(11))
- revid2 = self._dostore(oid, revid=revid1, data=MinPO(12))
+ self._dostore(oid, revid=revid1, data=MinPO(12))
self.assertRaises(POSException.ConflictError,
self._dostore,
oid, revid=revid1, data=MinPO(13))
More information about the Zope-Checkins
mailing list