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

Barry Warsaw barry@wooz.org
Tue, 8 Apr 2003 10:49:45 -0400


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

Modified Files:
	test_demo.py 
Log Message:
testNoDuplicateObjectIds(): New test for testing a problem found by
Marius Gedminus -- a demo storage handing out duplicate object ids.


=== Zope3/src/zodb/storage/tests/test_demo.py 1.4 => 1.5 ===
--- Zope3/src/zodb/storage/tests/test_demo.py:1.4	Thu Apr  3 16:48:19 2003
+++ Zope3/src/zodb/storage/tests/test_demo.py	Tue Apr  8 10:49:44 2003
@@ -118,6 +118,14 @@
         raises(VersionLockError, self._dostore,
                oid=oid, data=MinPO(8), revid=revid1, version='frontversion')
 
+    def testNoDuplicateObjectIds(self):
+        oids = {}
+        for i in range(10):
+            oids[self._storage.newObjectId()] = True
+        self.flip()
+        for i in range(10):
+            self.failIf(self._storage.newObjectId() in oids)
+
 
 def test_suite():
     suite = unittest.TestSuite()