[Zodb-checkins] CVS: ZODB3/ZODB/tests - StorageTestBase.py:1.26

Jeremy Hylton jeremy at zope.com
Thu May 1 14:09:42 EDT 2003


Update of /cvs-repository/ZODB3/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv10392/tests

Modified Files:
	StorageTestBase.py 
Log Message:
Deal with references in zodb_unpickle().


=== ZODB3/ZODB/tests/StorageTestBase.py 1.25 => 1.26 ===
--- ZODB3/ZODB/tests/StorageTestBase.py:1.25	Mon Mar 17 12:52:34 2003
+++ ZODB3/ZODB/tests/StorageTestBase.py	Thu May  1 13:09:41 2003
@@ -31,6 +31,7 @@
 from cStringIO import StringIO
 
 from ZODB.Transaction import Transaction
+from ZODB.utils import u64
 
 from ZODB.tests.MinPO import MinPO
 
@@ -64,10 +65,15 @@
     p.dump(state)
     return f.getvalue(1)
 
+def persistent_load(pid):
+    # helper for zodb_unpickle
+    return "ref to %s.%s oid=%s" % (pid[1][0], pid[1][1], u64(pid[0]))
+
 def zodb_unpickle(data):
     """Unpickle an object stored using the format expected by ZODB."""
     f = StringIO(data)
     u = Unpickler(f)
+    u.persistent_load = persistent_load
     klass_info = u.load()
     if isinstance(klass_info, types.TupleType):
         if isinstance(klass_info[0], types.TupleType):




More information about the Zodb-checkins mailing list