[Checkins] SVN: zope.app.interface/trunk/src/zope/app/interface/tests/test_interface.py Because MappingStorage does not support re-opening, it does not fit

Yusei Tahara yusei at domen.cx
Sat May 2 00:37:13 EDT 2009


Log message for revision 99665:
  Because MappingStorage does not support re-opening, it does not fit
  this test. Use FileStorage instead.
  

Changed:
  U   zope.app.interface/trunk/src/zope/app/interface/tests/test_interface.py

-=-
Modified: zope.app.interface/trunk/src/zope/app/interface/tests/test_interface.py
===================================================================
--- zope.app.interface/trunk/src/zope/app/interface/tests/test_interface.py	2009-05-02 02:23:04 UTC (rev 99664)
+++ zope.app.interface/trunk/src/zope/app/interface/tests/test_interface.py	2009-05-02 04:37:11 UTC (rev 99665)
@@ -25,7 +25,9 @@
 
 import transaction
 
-from ZODB.tests.util import DB
+from ZODB.FileStorage import FileStorage
+from ZODB.DB import DB
+from ZODB.tests import util
 from zodbcode.module import ManagedRegistry
 
 from zope.interface import Interface, implements, directlyProvides
@@ -77,11 +79,12 @@
 
 class IQux(Interface): pass
 
-class PersistentInterfaceTest(unittest.TestCase):
+class PersistentInterfaceTest(util.TestCase):
 
     def setUp(self):
-
-        self.db = DB()
+        super(PersistentInterfaceTest, self).setUp()
+        util.setUp(self)
+        self.db = DB(FileStorage('PersistentInterfaceTest.fs'))
         self.conn = self.db.open()
         self.root = self.conn.root()
         self.registry = ManagedRegistry()
@@ -89,6 +92,7 @@
         transaction.commit()
 
     def tearDown(self):
+        util.tearDown(self)
         transaction.abort() # just in case
 
     def test_creation(self):
@@ -139,8 +143,10 @@
                                    bar_code + '\nfoo = 1')
 
         transaction.commit()
+
         self.db.close()
-        root = self.db.open().root()
+        db = DB(FileStorage('PersistentInterfaceTest.fs'))
+        root = db.open().root()
 
         barmodule = root['registry'].findModule("barmodule")
 



More information about the Checkins mailing list