[Zodb-checkins] CVS: Packages/ZEO - Cache.py:1.3
jeremy@digicool.com
jeremy@digicool.com
Tue, 8 May 2001 18:34:57 -0400 (EDT)
Update of /cvs-repository/Packages/ZEO/tests
In directory korak:/tmp/cvs-serv20570/tests
Modified Files:
Cache.py
Log Message:
Add a second invalidation + commitVersion test, since the code path is
different depending on whether the version is different.
--- Updated File Cache.py in package Packages/ZEO --
--- Cache.py 2001/05/08 21:15:53 1.2
+++ Cache.py 2001/05/08 22:34:57 1.3
@@ -50,7 +50,7 @@
obj = zodb_unpickle(data)
assert obj == MinPO(2), obj
- def checkCommitVersionInvalidation(self):
+ def checkCommitEmptyVersionInvalidation(self):
oid = self._storage.new_oid()
revid = self._dostore(oid, data=MinPO(1))
revid = self._dostore(oid, revid=revid, data=MinPO(2))
@@ -62,5 +62,20 @@
self._storage.tpc_vote(t)
self._storage.tpc_finish(t)
data, revid = self._storage.load(oid, "")
+ obj = zodb_unpickle(data)
+ assert obj == MinPO(3), obj
+
+ def checkCommitVersionInvalidation(self):
+ oid = self._storage.new_oid()
+ revid = self._dostore(oid, data=MinPO(1))
+ revid = self._dostore(oid, revid=revid, data=MinPO(2))
+ revid = self._dostore(oid, revid=revid, data=MinPO(3), version="foo")
+ t = Transaction()
+ self._storage.tpc_begin(t)
+ self._storage.commitVersion("foo", "bar", t)
+ self._storage.load(oid, "")
+ self._storage.tpc_vote(t)
+ self._storage.tpc_finish(t)
+ data, revid = self._storage.load(oid, "bar")
obj = zodb_unpickle(data)
assert obj == MinPO(3), obj