[Zodb-checkins] CVS: ZODB3/ZODB/tests - VersionStorage.py:1.18
Barry Warsaw
barry@wooz.org
Thu, 24 Oct 2002 09:50:18 -0400
Update of /cvs-repository/ZODB3/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv17114
Modified Files:
VersionStorage.py
Log Message:
checkCreateObjectInVersionWithAbort(): A new test which specifically
tests for proper behavior when aborting a version in which an object
was created.
=== ZODB3/ZODB/tests/VersionStorage.py 1.17 => 1.18 ===
--- ZODB3/ZODB/tests/VersionStorage.py:1.17 Wed Aug 28 14:16:32 2002
+++ ZODB3/ZODB/tests/VersionStorage.py Thu Oct 24 09:50:18 2002
@@ -366,3 +366,16 @@
self._storage.load, oid, '')
self.assertRaises(KeyError,
self._storage.load, oid, 'two')
+
+ def checkCreateObjectInVersionWithAbort(self):
+ oid = self._storage.new_oid()
+ revid = self._dostore(oid, data=21, version="one")
+ revid = self._dostore(oid, revid=revid, data=23, version='one')
+ revid = self._dostore(oid, revid=revid, data=34, version='one')
+ # Now abort the version and the creation
+ t = Transaction()
+ self._storage.tpc_begin(t)
+ oids = self._storage.abortVersion('one', t)
+ self._storage.tpc_vote(t)
+ self._storage.tpc_finish(t)
+ self.assertEqual(oids, [oid])