[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - placefulsetup.py:1.8.2.3 test_eventservice.py:1.10.2.1

Guido van Rossum guido@python.org
Thu, 27 Feb 2003 20:43:59 -0500


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

Modified Files:
      Tag: use-config-branch
	placefulsetup.py test_eventservice.py 
Log Message:
Checkpoint commit on this branch -- something's still flakey, but I
can't figure out why and I may not get back to this until Monday.

Redid the __init__ of ServiceConfiguration and its ancestors to get
rid of the unnecessary *args / **kwds business, and added an optional
context argument.  When context is given, it is used to traverse to
the service object and we ensure that it implements IUseConfigurable
and IService -- all configured services must implement these.  When
context is not given, we don't perform this check -- this only happens
in the test suite.

Fixed various places that need to pass a context argument, and fixed
some services to implement the required interfaces.



=== Zope3/src/zope/app/services/tests/placefulsetup.py 1.8.2.2 => 1.8.2.3 ===
--- Zope3/src/zope/app/services/tests/placefulsetup.py:1.8.2.2	Wed Feb 26 17:14:14 2003
+++ Zope3/src/zope/app/services/tests/placefulsetup.py	Thu Feb 27 20:43:29 2003
@@ -171,12 +171,13 @@
         default.setObject(service_name, EventService())
 
         path = "%s/%s" % (getPhysicalPathString(default), service_name)
-        configuration = ServiceConfiguration(Events, path)
+        configuration = ServiceConfiguration(Events, path, self.rootFolder)
         default['configure'].setObject(
                 "%sEventsDir" % service_name, configuration)
         traverse(default, 'configure/1').status = Active
 
-        configuration = ServiceConfiguration(Subscription, path)
+        configuration = ServiceConfiguration(Subscription, path,
+                                             self.rootFolder)
         default['configure'].setObject(
                 "%sSubscriptionServiceDir" % service_name, configuration)
         traverse(default, 'configure/2').status = Active
@@ -209,17 +210,18 @@
         default.setObject("myObjectHub", self.getObjectHub())
 
         path = "%s/Packages/default/myEventService" % getPhysicalPathString(sm)
-        configuration = ServiceConfiguration(Events, path)
+        configuration = ServiceConfiguration(Events, path, self.rootFolder)
         default['configure'].setObject("myEventServiceDir", configuration)
         traverse(default, 'configure/1').status = Active
 
-        configuration = ServiceConfiguration(Subscription, path)
+        configuration = ServiceConfiguration(Subscription, path,
+                                             self.rootFolder)
         default['configure'].setObject(
                 "mySubscriptionServiceDir", configuration)
         traverse(default, 'configure/2').status = Active
 
         path = "%s/Packages/default/myObjectHub" % getPhysicalPathString(sm)
-        configuration = ServiceConfiguration(HubIds, path)
+        configuration = ServiceConfiguration(HubIds, path, self.rootFolder)
         default['configure'].setObject("myHubIdsServiceDir", configuration)
         traverse(default, 'configure/3').status = Active
 


=== Zope3/src/zope/app/services/tests/test_eventservice.py 1.10 => 1.10.2.1 ===
--- Zope3/src/zope/app/services/tests/test_eventservice.py:1.10	Tue Feb 11 21:17:34 2003
+++ Zope3/src/zope/app/services/tests/test_eventservice.py	Thu Feb 27 20:43:29 2003
@@ -42,6 +42,7 @@
 from zope.app.services.tests.eventsetup import EventSetup
 from zope.component.tests.components import RecordingAdapter
 from zope.component.adapter import provideAdapter
+from zope.app.interfaces.services.interfaces import ISimpleService
 
 class UnpromotingEventService(EventService):
 
@@ -68,7 +69,7 @@
         "gets location"
 
 class DumbObjectHub:
-    __implements__ = IObjectHub
+    __implements__ = IObjectHub, ISimpleService
 
     def __init__(self):
         # (location, object)