[Zodb-checkins] CVS: StandaloneZODB/ZODB/tests - BasicStorage.py:1.11

Barry Warsaw barry@wooz.org
Wed, 24 Oct 2001 18:17:18 -0400


Update of /cvs-repository/StandaloneZODB/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv26077

Modified Files:
	BasicStorage.py 
Log Message:
checkGetSerial(): New test for getSerial() in a non-version aware
situation.


=== StandaloneZODB/ZODB/tests/BasicStorage.py 1.10 => 1.11 ===
         revid4 = self._dostore(oid2, revid=revid2, data=p52)
         noteq(revid3, revid4)
+
+    def checkGetSerial(self):
+        eq = self.assertEqual
+        p41, p42 = map(MinPO, (41, 42))
+        oid = self._storage.new_oid()
+        self.assertRaises(KeyError, self._storage.getSerial, oid)
+        # Now store a revision
+        revid1 = self._dostore(oid, data=p41)
+        eq(revid1, self._storage.getSerial(oid))
+        # And another one
+        revid2 = self._dostore(oid, revid=revid1, data=p42)
+        eq(revid2, self._storage.getSerial(oid))