[Zope3-checkins] CVS: Zope3/lib/python/Persistence/BTrees/tests - testBTrees.py:1.20

Jeremy Hylton jeremy@zope.com
Wed, 24 Jul 2002 18:52:50 -0400


Update of /cvs-repository/Zope3/lib/python/Persistence/BTrees/tests
In directory cvs.zope.org:/tmp/cvs-serv31038/Persistence/BTrees/tests

Modified Files:
	testBTrees.py 
Log Message:
Use new-style DB() call,
and call _p_deactivate() instead of relying on _p_changed protocol.



=== Zope3/lib/python/Persistence/BTrees/tests/testBTrees.py 1.19 => 1.20 ===
         del self.t
 
     def _getRoot(self):
-        from ZODB.FileStorage import FileStorage
-        from ZODB.DB import DB
+        from ZODB.FileStorage import DB
         n = 'fs_tmp__%s' % os.getpid()
-        s = FileStorage(n)
-        db = DB(s, cache_size=1)
+        db = DB(n, cache_size=1)
         root = db.open().root()
         return root
 
@@ -92,9 +90,9 @@
             root = None
             try:
                 root = self._getRoot()
-                root[i]._p_changed = None
+                root[i]._p_deactivate()
                 get_transaction().commit()
-                if hasattr(t,'items'):
+                if hasattr(t, 'items'):
                     self.assertEqual(list(root[i].items()) , list(t.items()))
                 else:
                     self.assertEqual(list(root[i].keys()) , list(t.keys()))