[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - objecthubsetup.py:1.5 placefulsetup.py:1.6 test_eventservice.py:1.8

R. Sean Bowman sean.bowman@acm.org
Wed, 5 Feb 2003 23:31:29 -0500


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

Modified Files:
	objecthubsetup.py placefulsetup.py test_eventservice.py 
Log Message:
changed service names to use strings defined in
zope/component/servicenames.py, changed the name of
ErrorReportingService to ErrorReports


=== Zope3/src/zope/app/services/tests/objecthubsetup.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/services/tests/objecthubsetup.py:1.4	Mon Dec 30 10:08:17 2002
+++ Zope3/src/zope/app/services/tests/objecthubsetup.py	Wed Feb  5 23:30:54 2003
@@ -19,6 +19,7 @@
 
 from zope.app.services.tests.eventsetup import EventSetup
 from zope.component import getServiceManager, getService
+from zope.component.servicenames import HubIds
 from zope.app.services.service import ServiceConfiguration
 from zope.app.traversing import getPhysicalPathString, traverse
 from zope.app.traversing import locationAsTuple
@@ -98,5 +99,5 @@
         
     def setUp(self):
         EventSetup.setUp(self)
-        self.object_hub = getService(self.rootFolder, 'HubIds')
+        self.object_hub = getService(self.rootFolder, HubIds)
 


=== Zope3/src/zope/app/services/tests/placefulsetup.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/services/tests/placefulsetup.py:1.5	Mon Dec 30 09:03:17 2002
+++ Zope3/src/zope/app/services/tests/placefulsetup.py	Wed Feb  5 23:30:54 2003
@@ -19,6 +19,7 @@
 from zope import component as CA
 from zope.component.adapter import provideAdapter
 from zope.component.view import provideView
+from zope.component.servicenames import HubIds, Events, Subscription
 from zope.publisher.interfaces.browser import IBrowserPresentation
 
 from zope.app.browser.absoluteurl import SiteAbsoluteURL, AbsoluteURL
@@ -155,12 +156,12 @@
         default.setObject(service_name, EventService())
 
         path = "%s/%s" % (getPhysicalPathString(default), service_name)
-        configuration = ServiceConfiguration("Events", path)
+        configuration = ServiceConfiguration(Events, path)
         default['configure'].setObject(
                 "%sEventsDir" % service_name, configuration)
         traverse(default, 'configure/1').status = Active
 
-        configuration = ServiceConfiguration("Subscription", path)
+        configuration = ServiceConfiguration(Subscription, path)
         default['configure'].setObject(
                 "%sSubscriptionServiceDir" % service_name, configuration)
         traverse(default, 'configure/2').status = Active
@@ -180,12 +181,12 @@
         from zope.app.interfaces.services.hub import IObjectHub
         from zope.app.interfaces.services.event import ISubscriptionService
         from zope.app.services.event import EventService
-        defineService("Subscription", ISubscriptionService)
+        defineService(Subscription, ISubscriptionService)
 
         # Events service already defined by
         # zope.app.events.tests.PlacelessSetup
 
-        defineService("HubIds", IObjectHub)
+        defineService(HubIds, IObjectHub)
 
         sm = traverse(root, '++etc++Services')
         default = traverse(sm, 'Packages/default')
@@ -193,17 +194,17 @@
         default.setObject("myObjectHub", self.getObjectHub())
 
         path = "%s/Packages/default/myEventService" % getPhysicalPathString(sm)
-        configuration = ServiceConfiguration("Events", path)
+        configuration = ServiceConfiguration(Events, path)
         default['configure'].setObject("myEventServiceDir", configuration)
         traverse(default, 'configure/1').status = Active
 
-        configuration = ServiceConfiguration("Subscription", path)
+        configuration = ServiceConfiguration(Subscription, path)
         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)
         default['configure'].setObject("myHubIdsServiceDir", configuration)
         traverse(default, 'configure/3').status = Active
 


=== Zope3/src/zope/app/services/tests/test_eventservice.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/tests/test_eventservice.py:1.7	Mon Feb  3 10:59:17 2003
+++ Zope3/src/zope/app/services/tests/test_eventservice.py	Wed Feb  5 23:30:54 2003
@@ -21,6 +21,7 @@
 from zope.interface import Interface
 from zope.app.services.service import ServiceManager, ServiceConfiguration
 from zope.component import getServiceManager
+from zope.component.servicenames import Events, Subscription
 from zope.app.services.event import EventService
 from zope.app.traversing import getPhysicalPathString, traverse
 from zope.exceptions import NotFoundError
@@ -810,11 +811,11 @@
         default.setObject("myEventService", service)
 
         path = "%s/Packages/default/myEventService" % getPhysicalPathString(sm)
-        configuration = ServiceConfiguration("Events", path)
+        configuration = ServiceConfiguration(Events, path)
         default['configure'].setObject("myEventServiceDir", configuration)
         traverse(default, 'configure/1').status = Active
 
-        configuration = ServiceConfiguration("Subscription", path)
+        configuration = ServiceConfiguration(Subscription, path)
         default['configure'].setObject("mySubscriptionServiceDir",
                                        configuration)
         traverse(
@@ -867,13 +868,13 @@
             )
 
         sm = traverse(self.rootFolder, "folder1/++etc++Services")
-        configuration = sm.queryConfigurations("Events").active()
+        configuration = sm.queryConfigurations(Events).active()
         configuration.status = Registered
         publish(self.rootFolder, ObjectAddedEvent(None, '/foo'))
         self.assertEqual(self.folder1Subscriber.notified, 1)
         self.assertEqual(self.folder1_1Subscriber.notified, 1)
 
-        configuration = sm.queryConfigurations("Subscription").active()
+        configuration = sm.queryConfigurations(Subscription).active()
         configuration.status = Registered
 
         publish(self.rootFolder, ObjectAddedEvent(None, '/foo'))
@@ -891,10 +892,10 @@
         self.assertEqual(self.rootFolderSubscriber.notified, 1)
 
         sm = traverse(self.rootFolder, "folder2/++etc++Services")
-        configuration = sm.queryConfigurations("Subscription").active()
+        configuration = sm.queryConfigurations(Subscription).active()
         # make sure it doesn't raise any errors
         configuration.status = Registered
-        configuration = sm.queryConfigurations("Events").active()
+        configuration = sm.queryConfigurations(Events).active()
         # make sure it doesn't raise any errors
         configuration.status = Registered