[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_modulelookup.py:1.4

Jim Fulton jim at zope.com
Sun Sep 21 13:33:17 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv15200/src/zope/app/services/tests

Modified Files:
	test_modulelookup.py 
Log Message:
No-longer use context wrappers.

Added setUp and tearDown for tests. This was needed to set up an event
service to handle events published by container operations.


=== Zope3/src/zope/app/services/tests/test_modulelookup.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/services/tests/test_modulelookup.py:1.3	Thu Jul  3 11:42:48 2003
+++ Zope3/src/zope/app/services/tests/test_modulelookup.py	Sun Sep 21 13:33:17 2003
@@ -20,12 +20,12 @@
 """
 
 from zope.testing.doctestunit import DocTestSuite
-from zope.context import Wrapper
 
 from zope.app.services.registration import RegistrationManagerContainer
 from zope.app.interfaces.services.module import IModuleManager
 from zope.interface import implements
-
+from zope.app.container.contained import Contained, setitem
+from zope.app.tests.placelesssetup import setUp, tearDown
 
 class MyModuleManager(object):
     implements(IModuleManager)
@@ -36,10 +36,9 @@
     def getModule(self):
         return self.module
 
-class MyFolder(RegistrationManagerContainer, dict):
-    def setObject(self, name, object):
-        self[name] = object
-        return name
+class MyFolder(RegistrationManagerContainer, dict, Contained):
+    def __setitem__(self, name, object):
+        setitem(self, super(MyFolder, self).__setitem__, name, object)
 
 
 def test_findMoule():
@@ -52,7 +51,7 @@
     >>> next = MyFolder()
     >>> next['m3'] = MyModuleManager(3)
     >>> next['z.y.m4'] = MyModuleManager(4)
-    >>> folder = Wrapper(folder, next)
+    >>> folder.__parent__ = next
 
     >>> folder.findModule('m1')
     1
@@ -84,5 +83,7 @@
     1
     """
 
-def test_suite(): return DocTestSuite()
+def test_suite():
+    return DocTestSuite(setUp=setUp, tearDown=tearDown)
+
 if __name__ == '__main__': unittest.main()




More information about the Zope3-Checkins mailing list