[Zope3-checkins] CVS: Zope3/lib/python/ZODB/tests - MTStorage.py:1.9 PackableStorage.py:1.16 testZODB.py:1.9

Jeremy Hylton jeremy@zope.com
Mon, 5 Aug 2002 16:09:09 -0400


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

Modified Files:
	MTStorage.py PackableStorage.py testZODB.py 
Log Message:
PersistentMapping is now PersistentDict (by popular demand).

Note that this change will break any old pickles.






=== Zope3/lib/python/ZODB/tests/MTStorage.py 1.8 => 1.9 ===
 import time
 
 import ZODB.DB
-from Persistence.PersistentMapping import PersistentMapping
+from Persistence.PersistentDict import PersistentDict
 from Transaction import get_transaction
 from ZODB.ZTransaction import Transaction
 
@@ -65,7 +65,7 @@
         # arbitrarily limit to 10 re-tries
         for i in range(10):
             try:
-                m = PersistentMapping()
+                m = PersistentDict()
                 root[name] = m
                 get_transaction().commit()
                 break


=== Zope3/lib/python/ZODB/tests/PackableStorage.py 1.15 => 1.16 ===
         try:
             self._storage.load(ZERO, '')
         except KeyError:
-            from Persistence.PersistentMapping import PersistentMapping
+            from Persistence.PersistentDict import PersistentDict
             from ZODB.ZTransaction import Transaction
             file = StringIO()
             p = cPickle.Pickler(file, 1)
-            p.dump((PersistentMapping, None))
-            p.dump({'_container': {}})
-            t=Transaction()
-            t.description='initial database creation'
+            p.dump((PersistentDict, None))
+            p.dump(PersistentDict().__getstate__())
+            t = Transaction()
+            t.note("initial database creation")
             self._storage.tpc_begin(t)
             self._storage.store(ZERO, None, file.getvalue(), '', t)
             self._storage.tpc_vote(t)


=== Zope3/lib/python/ZODB/tests/testZODB.py 1.8 => 1.9 ===
 import unittest
 
 import ZODB.DB, ZODB.FileStorage
-from Persistence.PersistentMapping import PersistentMapping
+from Persistence.PersistentDict import PersistentDict
 from Transaction import get_transaction
 from ZODB.utils import u64
 
@@ -105,9 +105,9 @@
         get_transaction().begin()
         conn = self._db.open()
         root = conn.root()
-        root['test'] = pm = PersistentMapping()
+        root['test'] = pm = PersistentDict()
         for n in range(100):
-            pm[n] = PersistentMapping({0: 100 - n})
+            pm[n] = PersistentDict({0: 100 - n})
         get_transaction().note('created test data')
         get_transaction().commit()
         conn.close()