[Zodb-checkins] CVS: ZODB/src/ZODB/tests - testConnection.py:1.16

Jeremy Hylton jeremy at zope.com
Fri Apr 16 15:55:10 EDT 2004

Update of /cvs-repository/ZODB/src/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv25453/src/ZODB/tests

Modified Files:
Log Message:
Variant of a patch from Gintautas Miliauskas.

The old code used itertools.chain(), which didn't work as expected.
If the first of the two iterator grew after the chain had started
consuming the second iterator, the new element(s) in the first
iterator would never be consumed.  

Fix this bug by eliminating the need for chaining.  Process all the
_added_during_commit objects at the end, each with its own
ObjectWriter instance.

=== ZODB/src/ZODB/tests/testConnection.py 1.15 => 1.16 ===
--- ZODB/src/ZODB/tests/testConnection.py:1.15	Fri Apr 16 15:07:04 2004
+++ ZODB/src/ZODB/tests/testConnection.py	Fri Apr 16 15:55:05 2004
@@ -115,7 +115,9 @@
         self.assertEquals(self.db._storage._finished, [oid])
     def checkModifyOnGetstate(self):
+        member = StubObject()
         subobj = StubObject()
+        subobj.member = member
         obj = ModifyOnGetStateObject(subobj)
@@ -125,6 +127,7 @@
         self.assert_(obj._p_oid in storage._stored, "object was not stored")
         self.assert_(subobj._p_oid in storage._stored,
                 "subobject was not stored")
+        self.assert_(member._p_oid in storage._stored, "member was not stored")
         self.assert_(self.datamgr._added_during_commit is None)
     def checkUnusedAddWorks(self):

More information about the Zodb-checkins mailing list