[Zodb-checkins] CVS: Zope/lib/python/ZODB/tests - PackableStorage.py:1.15.28.3

Toby Dickenson tdickenson at geminidataloggers.com
Thu May 15 04:44:28 EDT 2003


Update of /cvs-repository/Zope/lib/python/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv19393

Modified Files:
      Tag: toby_directorystorage_tests_branch
	PackableStorage.py 
Log Message:
Undo my previous changes to this test. It is better to leave these tests creating dangling refernces, and turn off DirectoryStorage's dangling reference detector.

=== Zope/lib/python/ZODB/tests/PackableStorage.py 1.15.28.2 => 1.15.28.3 ===
--- Zope/lib/python/ZODB/tests/PackableStorage.py:1.15.28.2	Wed May 14 17:49:13 2003
+++ Zope/lib/python/ZODB/tests/PackableStorage.py	Thu May 15 03:44:26 2003
@@ -199,9 +199,6 @@
         # Create a persistent object, with some initial state
         obj = self._newobj()
         oid = obj.getoid()
-        # Store the persistent object first, to avoid causing a dangling
-        # reference when committing the root. This revision isnt otherwise used.
-        revidn1 = self._dostoreNP(oid, data=pickle.dumps(obj))
         # Link the root object to the persistent object, in order to keep the
         # persistent object alive.  Store the root object.
         root.obj = obj
@@ -213,7 +210,7 @@
         eq(loads(data).value, 0)
         # Commit three different revisions of the other object
         obj.value = 1
-        revid1 = self._dostoreNP(oid, revid=revidn1, data=pickle.dumps(obj))
+        revid1 = self._dostoreNP(oid, data=pickle.dumps(obj))
         obj.value = 2
         revid2 = self._dostoreNP(oid, revid=revid1, data=pickle.dumps(obj))
         obj.value = 3
@@ -266,13 +263,11 @@
         # Create a persistent object, with some initial state
         obj1 = self._newobj()
         oid1 = obj1.getoid()
-        revidn2 = self._dostoreNP(oid1, data=pickle.dumps(obj1))
         # Create another persistent object, with some initial state.  Make
         # sure it's oid is greater than the first object's oid.
         obj2 = self._newobj()
         oid2 = obj2.getoid()
         self.failUnless(oid2 > oid1)
-        revidn1 = self._dostoreNP(oid2, data=pickle.dumps(obj2))
         # Link the root object to the persistent objects, in order to keep
         # them alive.  Store the root object.
         root.obj1 = obj1
@@ -285,7 +280,7 @@
         eq(loads(data).value, 0)
         # Commit three different revisions of the first object
         obj1.value = 1
-        revid1 = self._dostoreNP(oid1, revid=revidn2, data=pickle.dumps(obj1))
+        revid1 = self._dostoreNP(oid1, data=pickle.dumps(obj1))
         obj1.value = 2
         revid2 = self._dostoreNP(oid1, revid=revid1, data=pickle.dumps(obj1))
         obj1.value = 3
@@ -305,7 +300,7 @@
         eq(pobj.value, 3)
         # Now commit a revision of the second object
         obj2.value = 11
-        revid4 = self._dostoreNP(oid2, revid=revidn1, data=pickle.dumps(obj2))
+        revid4 = self._dostoreNP(oid2, data=pickle.dumps(obj2))
         # And make sure the revision can be extracted
         data = self._storage.loadSerial(oid2, revid4)
         pobj = pickle.loads(data)




More information about the Zodb-checkins mailing list