[Zope3-checkins] CVS: Zope3/src/zodb/storage/tests - version.py:1.5

Jeremy Hylton jeremy@zope.com
Thu, 13 Mar 2003 17:04:13 -0500


Update of /cvs-repository/Zope3/src/zodb/storage/tests
In directory cvs.zope.org:/tmp/cvs-serv32237/storage/tests

Modified Files:
	version.py 
Log Message:
Use _abortVersion() and _commitVersion() helper functions defined in base.


=== Zope3/src/zodb/storage/tests/version.py 1.4 => 1.5 ===
--- Zope3/src/zodb/storage/tests/version.py:1.4	Thu Mar 13 16:32:29 2003
+++ Zope3/src/zodb/storage/tests/version.py	Thu Mar 13 17:04:11 2003
@@ -228,11 +228,7 @@
         data, revid = self._storage.load(oid, '')
         eq(zodb_unpickle(data), MinPO(51))
         # Try committing this version to the empty version
-        t = Transaction()
-        self._storage.tpcBegin(t)
-        oids = self._storage.commitVersion(version, '', t)
-        self._storage.tpcVote(t)
-        self._storage.tpcFinish(t)
+        oids = self._commitVersion(version, "")
         data, revid = self._storage.load(oid, '')
         eq(zodb_unpickle(data), MinPO(54))
 
@@ -254,13 +250,8 @@
         data, revid2 = self._storage.load(oid1, '')
         eq(zodb_unpickle(data), MinPO(51))
 
-        # Okay, now let's commit object1 to version2
-        t = Transaction()
-        self._storage.tpcBegin(t)
-        oids = self._storage.commitVersion(version1, version2,
-                                           t)
-        self._storage.tpcVote(t)
-        self._storage.tpcFinish(t)
+        # Okay, now let's commit version1 to version2
+        oids = self._commitVersion(version1, version2)
         eq(len(oids), 1)
         eq(oids[0], oid1)
         data, revid = self._storage.load(oid1, version2)
@@ -290,32 +281,17 @@
         data, revid2 = self._storage.load(oid1, version2)
         eq(zodb_unpickle(data), MinPO(51))
 
-        # First, let's abort version1
-        t = Transaction()
-        self._storage.tpcBegin(t)
-        oids = self._storage.abortVersion(version1, t)
-        self._storage.tpcVote(t)
-        self._storage.tpcFinish(t)
+        oids = self._abortVersion(version1)
         eq(len(oids), 1)
         eq(oids[0], oid1)
         data, revid = self._storage.load(oid1, '')
         eq(zodb_unpickle(data), MinPO(51))
 
-        data, revid = self._storage.load(oid1, '')
-        eq(zodb_unpickle(data), MinPO(51))
-        data, revid = self._storage.load(oid1, '')
-        eq(zodb_unpickle(data), MinPO(51))
-
         data, revid = self._storage.load(oid2, '')
         eq(zodb_unpickle(data), MinPO(51))
         data, revid = self._storage.load(oid2, version2)
         eq(zodb_unpickle(data), MinPO(54))
-        # Okay, now let's commit version2 back to the trunk
-        t = Transaction()
-        self._storage.tpcBegin(t)
-        oids = self._storage.commitVersion(version2, '', t)
-        self._storage.tpcVote(t)
-        self._storage.tpcFinish(t)
+        oids = self._commitVersion(version2, "")
         eq(len(oids), 1)
         eq(oids[0], oid2)
         data, revid = self._storage.load(oid1, '')