[Zope-Checkins] CVS: StandaloneZODB/ZODB/tests - VersionStorage.py:1.9
Jeremy Hylton
jeremy@zope.com
Wed, 24 Oct 2001 16:52:26 -0400
Update of /cvs-repository/StandaloneZODB/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv7531/ZODB/tests
Modified Files:
VersionStorage.py
Log Message:
Add a simple test of getSerial().
Didn't write a more interesting test in checkAbortVersion:
# XXX Not sure I can write a test for getSerial() in the
# presence of aborted versions, because FileStorage and
# Berkeley storage give a different answer. I think Berkeley
# is right and FS is wrong.
=== StandaloneZODB/ZODB/tests/VersionStorage.py 1.8 => 1.9 ===
data, revid = self._storage.load(oid, '')
eq(zodb_unpickle(data), MinPO(12))
- data, revid = self._storage.load(oid, version)
+ data, vrevid = self._storage.load(oid, version)
eq(zodb_unpickle(data), MinPO(15))
+ s = self._storage.getSerial(oid)
+ eq(s, max(revid, vrevid))
def checkVersionedLoadErrors(self):
oid = self._storage.new_oid()
@@ -133,11 +135,20 @@
def checkAbortVersion(self):
eq = self.assertEqual
oid, version = self._setup_version()
+
+ # XXX Not sure I can write a test for getSerial() in the
+ # presence of aborted versions, because FileStorage and
+ # Berkeley storage give a different answer. I think Berkeley
+ # is right and FS is wrong.
+
+## s1 = self._storage.getSerial(oid)
# Now abort the version -- must be done in a transaction
self._storage.tpc_begin(self._transaction)
oids = self._storage.abortVersion(version, self._transaction)
self._storage.tpc_vote(self._transaction)
self._storage.tpc_finish(self._transaction)
+## s2 = self._storage.getSerial(oid)
+## eq(s1, s2) # or self.assert(s2 > s1) ?
eq(len(oids), 1)
eq(oids[0], oid)
data, revid = self._storage.load(oid, '')