[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - placefulsetup.py:1.16 test_adapter.py:1.6 test_auth.py:1.11 test_cacheconfiguration.py:1.5 test_cachingservice.py:1.7 test_configurationmanager.py:1.6 test_connectionconfiguration.py:1.5 test_connectionservice.py:1.5 test_eventservice.py:1.18 test_pagefolder.py:1.2 test_serviceconfiguration.py:1.7 test_servicemanager.py:1.5 test_view.py:1.8

Jim Fulton jim@zope.com
Sun, 23 Mar 2003 17:03:59 -0500


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

Modified Files:
	placefulsetup.py test_adapter.py test_auth.py 
	test_cacheconfiguration.py test_cachingservice.py 
	test_configurationmanager.py test_connectionconfiguration.py 
	test_connectionservice.py test_eventservice.py 
	test_pagefolder.py test_serviceconfiguration.py 
	test_servicemanager.py test_view.py 
Log Message:
Changed the name of configuration managers created in site-management
folders to "ConfigurationManager".

Updated all code that accessed configuration managers to use
getConfigurationManager rather that traversing containers with
hardcoded names.


=== Zope3/src/zope/app/services/tests/placefulsetup.py 1.15 => 1.16 ===
--- Zope3/src/zope/app/services/tests/placefulsetup.py:1.15	Sun Mar 23 12:13:42 2003
+++ Zope3/src/zope/app/services/tests/placefulsetup.py	Sun Mar 23 17:03:28 2003
@@ -173,15 +173,15 @@
 
         path = "%s/%s" % (getPath(default), service_name)
         configuration = ServiceConfiguration(EventPublication, path, self.rootFolder)
-        default['configure'].setObject(
+        default.getConfigurationManager().setObject(
                 "%sEventsDir" % service_name, configuration)
-        traverse(default, 'configure/1').status = Active
+        traverse(default.getConfigurationManager(), '1').status = Active
 
         configuration = ServiceConfiguration(EventSubscription, path,
                                              self.rootFolder)
-        default['configure'].setObject(
+        default.getConfigurationManager().setObject(
                 "%sSubscriptionServiceDir" % service_name, configuration)
-        traverse(default, 'configure/2').status = Active
+        traverse(default.getConfigurationManager(), '2').status = Active
 
     def createStandardServices(self):
         '''Create a bunch of standard placeful services'''
@@ -212,19 +212,19 @@
 
         path = "%s/default/myEventService" % getPath(sm)
         configuration = ServiceConfiguration(EventPublication, path, self.rootFolder)
-        default['configure'].setObject("myEventServiceDir", configuration)
-        traverse(default, 'configure/1').status = Active
+        default.getConfigurationManager().setObject("myEventServiceDir", configuration)
+        traverse(default.getConfigurationManager(), '1').status = Active
 
         configuration = ServiceConfiguration(EventSubscription, path,
                                              self.rootFolder)
-        default['configure'].setObject(
+        default.getConfigurationManager().setObject(
                 "mySubscriptionServiceDir", configuration)
-        traverse(default, 'configure/2').status = Active
+        traverse(default.getConfigurationManager(), '2').status = Active
 
         path = "%s/default/myObjectHub" % getPath(sm)
         configuration = ServiceConfiguration(HubIds, path, self.rootFolder)
-        default['configure'].setObject("myHubIdsServiceDir", configuration)
-        traverse(default, 'configure/3').status = Active
+        default.getConfigurationManager().setObject("myHubIdsServiceDir", configuration)
+        traverse(default.getConfigurationManager(), '3').status = Active
 
 
 def createServiceManager(folder):


=== Zope3/src/zope/app/services/tests/test_adapter.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/services/tests/test_adapter.py:1.5	Tue Mar 18 16:02:23 2003
+++ Zope3/src/zope/app/services/tests/test_adapter.py	Sun Mar 23 17:03:28 2003
@@ -115,7 +115,7 @@
 
         sm = traverse(self.rootFolder, '++etc++Services')
 
-        configure = traverse(sm, 'default/configure')
+        configure = traverse(sm, 'default').getConfigurationManager()
         configuration = Configuration()
         configure.setObject('', configuration)
         configuration = traverse(configure, '1')
@@ -153,7 +153,7 @@
 
         sm = traverse(self.rootFolder, '++etc++Services')
 
-        configure = traverse(sm, 'default/configure')
+        configure = traverse(sm, 'default').getConfigurationManager()
         configuration = Configuration()
         configuration.adapterName = u"Yatta!"
         configure.setObject('', configuration)
@@ -205,7 +205,7 @@
 
         sm = traverse(self.rootFolder, '++etc++Services')
 
-        configure = traverse(sm, 'default/configure')
+        configure = traverse(sm, 'default').getConfigurationManager()
         configuration = Configuration()
         configure.setObject('', configuration)
         configuration = traverse(configure, '1')


=== Zope3/src/zope/app/services/tests/test_auth.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/services/tests/test_auth.py:1.10	Wed Mar 19 14:57:32 2003
+++ Zope3/src/zope/app/services/tests/test_auth.py	Sun Mar 23 17:03:28 2003
@@ -68,7 +68,7 @@
 
         path = getPath(auth)
         configuration = ServiceConfiguration(Authentication, path)
-        configure = traverse(default, 'configure')
+        configure = default.getConfigurationManager()
         key = configure.setObject(None, configuration)
         traverse(configure, key).status = Active
 


=== Zope3/src/zope/app/services/tests/test_cacheconfiguration.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/services/tests/test_cacheconfiguration.py:1.4	Tue Mar 18 16:02:23 2003
+++ Zope3/src/zope/app/services/tests/test_cacheconfiguration.py	Sun Mar 23 17:03:28 2003
@@ -109,17 +109,17 @@
         self.default.setObject('cch', TestCache())
         self.cch = traverse(self.default, 'cch')
 
-        self.cm = ZopeContainerAdapter(traverse(self.default, "configure"))
+        self.cm = ZopeContainerAdapter(self.default.getConfigurationManager())
         self.cm.setObject('', CacheConfiguration('cache_name',
                             '/++etc++Services/default/cch'))
-        self.config = traverse(self.default, 'configure/1')
+        self.config = traverse(self.default.getConfigurationManager(), '1')
 
         self.default.setObject('cache_srv', CachingServiceStub())
         self.service = traverse(self.default, 'cache_srv')
 
         self.cm.setObject('', ServiceConfiguration('Caching',
                             '/++etc++Services/default/cache_srv'))
-        traverse(self.default, 'configure/2').status = Active
+        traverse(self.default.getConfigurationManager(), '2').status = Active
 
     def tearDown(self):
         PlacefulSetup.tearDown(self)


=== Zope3/src/zope/app/services/tests/test_cachingservice.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/services/tests/test_cachingservice.py:1.6	Wed Mar 19 14:57:32 2003
+++ Zope3/src/zope/app/services/tests/test_cachingservice.py	Sun Mar 23 17:03:28 2003
@@ -63,7 +63,7 @@
 
         path = getPath(service)
         configuration = ServiceConfiguration("Caching", path)
-        configure = traverse(default, 'configure')
+        configure = default.getConfigurationManager()
         key = configure.setObject(None, configuration)
         traverse(configure, key).status = Active
 
@@ -78,7 +78,7 @@
                            folder +'/++etc++Services/default')
         key = default.setObject(cname, cache)
         cache = traverse(default, key)
-        configure = traverse(default, 'configure')
+        configure = default.getConfigurationManager()
         key = configure.setObject(None, CacheConfiguration(name,
                                                            getPath(cache)))
         traverse(configure, key).status = status


=== Zope3/src/zope/app/services/tests/test_configurationmanager.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/services/tests/test_configurationmanager.py:1.5	Sun Mar 23 14:24:46 2003
+++ Zope3/src/zope/app/services/tests/test_configurationmanager.py	Sun Mar 23 17:03:28 2003
@@ -349,9 +349,9 @@
         sm = placefulsetup.createServiceManager(self.rootFolder)
         default = traverse(sm, 'default')
         self.assertEqual(default.getConfigurationManager(),
-                         default['configure'])
+                         default['ConfigurationManager'])
         default.setObject('xxx', ConfigurationManager())
-        del default['configure']
+        del default['ConfigurationManager']
         self.assertEqual(default.getConfigurationManager(),
                          default['xxx'])
 
@@ -368,7 +368,7 @@
         self.assertRaises(Exception,
                           default.__delitem__, 'configuration')
         default.setObject('xxx', ConfigurationManager())
-        del default['configure']
+        del default['ConfigurationManager']
         
 
 


=== Zope3/src/zope/app/services/tests/test_connectionconfiguration.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/services/tests/test_connectionconfiguration.py:1.4	Tue Mar 18 16:02:23 2003
+++ Zope3/src/zope/app/services/tests/test_connectionconfiguration.py	Sun Mar 23 17:03:28 2003
@@ -99,17 +99,17 @@
         self.default.setObject('da', TestDA())
         self.da = traverse(self.default, 'da')
 
-        self.cm = ZopeContainerAdapter(traverse(self.default, "configure"))
+        self.cm = ZopeContainerAdapter(self.default.getConfigurationManager())
         self.cm.setObject('', ConnectionConfiguration('conn_name',
                             '/++etc++Services/default/da'))
-        self.config = traverse(self.default, 'configure/1')
+        self.config = traverse(self.default.getConfigurationManager(), '1')
 
         self.default.setObject('conn_srv', ConnectionServiceStub())
         self.service = traverse(self.default, 'conn_srv')
 
         self.cm.setObject('', ServiceConfiguration('SQLDatabaseConnections',
                             '/++etc++Services/default/conn_srv'))
-        traverse(self.default, 'configure/2').status = Active
+        traverse(self.default.getConfigurationManager(), '2').status = Active
 
     def tearDown(self):
         PlacefulSetup.tearDown(self)


=== Zope3/src/zope/app/services/tests/test_connectionservice.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/services/tests/test_connectionservice.py:1.4	Tue Mar 18 16:02:23 2003
+++ Zope3/src/zope/app/services/tests/test_connectionservice.py	Sun Mar 23 17:03:28 2003
@@ -83,23 +83,23 @@
         self.default.setObject('conn_srv', ConnectionServiceForTests())
         self.service = traverse(self.default, 'conn_srv')
 
-        self.cm = ZopeContainerAdapter(traverse(self.default, "configure"))
+        self.cm = ZopeContainerAdapter(self.default.getConfigurationManager())
         self.cm.setObject('', ServiceConfiguration('SQLDatabaseConnections',
                                 '/++etc++Services/default/conn_srv'))
-        traverse(self.default, 'configure/1').status = Active
+        traverse(self.default.getConfigurationManager(), '1').status = Active
 
         self.default.setObject('da1', DAStub(1))
         self.default.setObject('da2', DAStub(2))
 
         self.cm.setObject('', ConnectionConfiguration('conn1',
                                 '/++etc++Services/default/da1'))
-        traverse(self.default, 'configure/2').status = Active
+        traverse(self.default.getConfigurationManager(), '2').status = Active
         self.cm.setObject('', ConnectionConfiguration('conn2',
                                 '/++etc++Services/default/da2'))
-        traverse(self.default, 'configure/3').status = Active
+        traverse(self.default.getConfigurationManager(), '3').status = Active
         self.cm.setObject('', ConnectionConfiguration('conn3',
                                 '/++etc++Services/default/da1'))
-        traverse(self.default, 'configure/4').status = Registered
+        traverse(self.default.getConfigurationManager(), '4').status = Registered
         # Now self.service has conn1 and conn2 available and knows about conn3
 
         # Set up a more local connection service
@@ -110,20 +110,20 @@
         default1.setObject('conn_srv1', ConnectionServiceForTests())
         self.service1 = traverse(default1, 'conn_srv1')
 
-        cm1 = ZopeContainerAdapter(traverse(default1, "configure"))
+        cm1 = ZopeContainerAdapter(default1.getConfigurationManager())
         cm1.setObject('', ServiceConfiguration('SQLDatabaseConnections',
                 '/folder1/++etc++Services/default/conn_srv1'))
-        traverse(default1, 'configure/1').status = Active
+        traverse(default1.getConfigurationManager(), '1').status = Active
 
         default1.setObject('da3', DAStub(3))
         default1.setObject('da4', DAStub(4))
 
         cm1.setObject('', ConnectionConfiguration('conn1',
                             '/folder1/++etc++Services/default/da3'))
-        traverse(default1, 'configure/2').status = Active
+        traverse(default1.getConfigurationManager(), '2').status = Active
         cm1.setObject('', ConnectionConfiguration('conn4',
                             '/folder1/++etc++Services/default/da4'))
-        traverse(default1, 'configure/3').status = Active
+        traverse(default1.getConfigurationManager(), '3').status = Active
         # Now self.service1 overrides conn1, adds new conn4 available, and
         # inherits conn2 from self.service
 


=== Zope3/src/zope/app/services/tests/test_eventservice.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/services/tests/test_eventservice.py:1.17	Wed Mar 19 14:57:32 2003
+++ Zope3/src/zope/app/services/tests/test_eventservice.py	Sun Mar 23 17:03:28 2003
@@ -839,15 +839,13 @@
 
         path = "%s/default/myEventService" % getPath(sm)
         configuration = ServiceConfiguration(EventPublication, path)
-        default['configure'].setObject("myEventServiceDir", configuration)
-        traverse(default, 'configure/1').status = Active
+        default.getConfigurationManager().setObject("myEventServiceDir", configuration)
+        traverse(default.getConfigurationManager(), '1').status = Active
 
         configuration = ServiceConfiguration(EventSubscription, path)
-        default['configure'].setObject("mySubscriptionServiceDir",
+        default.getConfigurationManager().setObject("mySubscriptionServiceDir",
                                        configuration)
-        traverse(
-            default,
-            'configure/2').status = Active
+        traverse(default.getConfigurationManager(), '2').status = Active
 
         subscribe(
             self.rootFolderSubscriber,


=== Zope3/src/zope/app/services/tests/test_pagefolder.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/services/tests/test_pagefolder.py:1.1	Sun Mar 23 14:24:46 2003
+++ Zope3/src/zope/app/services/tests/test_pagefolder.py	Sun Mar 23 17:03:28 2003
@@ -46,7 +46,7 @@
 
         #set up view service
         default.setObject('ViewService', ViewService())
-        configure = traverse(default, 'configure')
+        configure = default.getConfigurationManager()
         configuration = ServiceConfiguration(
             'Views',
             '/++etc++Services/default/ViewService')
@@ -56,7 +56,7 @@
 
         views.setObject('foo.html', ZPTTemplate())
 
-        configuration = traverse(views, 'configure/1')
+        configuration = traverse(views.getConfigurationManager(), '1')
         self.assertEqual(configuration.status, Active)
         self.assertEqual(configuration.forInterface, I)
         self.assertEqual(configuration.presentationType, IBrowserPresentation)


=== Zope3/src/zope/app/services/tests/test_serviceconfiguration.py 1.6 => 1.7 ===
--- Zope3/src/zope/app/services/tests/test_serviceconfiguration.py:1.6	Tue Mar 18 16:02:23 2003
+++ Zope3/src/zope/app/services/tests/test_serviceconfiguration.py	Sun Mar 23 17:03:28 2003
@@ -23,7 +23,7 @@
 from zope.interface import Interface
 
 from zope.component import getServiceManager, getAdapter
-from zope.app.traversing import traverse
+from zope.app.traversing import traverse, getPath
 from zope.app.services.service import ServiceConfiguration
 from zope.app.services.tests.placefulsetup import PlacefulSetup
 from zope.app.services.service import ServiceManager
@@ -92,11 +92,12 @@
             'test_service', '/++etc++Services/default/c')
 
         self.__c = traverse(default, 'c')
-        self.__cm = ZopeContainerAdapter(traverse(default, "configure"))
+        self.__cm = ZopeContainerAdapter(default.getConfigurationManager())
 
         self.__cm.setObject('', configuration)
 
-        self.__config = traverse(default, 'configure/1')
+        self.__config = traverse(default.getConfigurationManager(), '1')
+        self.__configpath = getPath(self.__config)
 
     def test_activated(self):
         old = self.__c._bound
@@ -119,10 +120,10 @@
 
     def test_afterAddHook(self):
         self.assertEqual(self.__c._dependents,
-                         ('/++etc++Services/default/configure/1', ))
+                         (self.__configpath, ))
         u = getAdapter(self.__c, IUseConfiguration)
         self.assertEqual(list(u.usages()),
-                         ['/++etc++Services/default/configure/1'])
+                         [self.__configpath])
 
     def test_beforeDeleteHook_and_unregistered(self):
         self.__config.status = Registered


=== Zope3/src/zope/app/services/tests/test_servicemanager.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/services/tests/test_servicemanager.py:1.4	Sun Mar 23 11:45:45 2003
+++ Zope3/src/zope/app/services/tests/test_servicemanager.py	Sun Mar 23 17:03:28 2003
@@ -64,8 +64,8 @@
             'test_service',
             '/++etc++Services/default/test_service1')
 
-        default['configure'].setObject('', configuration)
-        traverse(default, 'configure/1').status = Active
+        default.getConfigurationManager().setObject('', configuration)
+        traverse(default.getConfigurationManager(), '1').status = Active
 
         testOb = getService(self.rootFolder, 'test_service')
         c = getWrapperContainer
@@ -89,16 +89,16 @@
         configuration = ServiceConfiguration(
             'test_service',
             '/++etc++Services/default/test_service1')
-        default['configure'].setObject('', configuration)
-        traverse(default, 'configure/1').status = Active
+        default.getConfigurationManager().setObject('', configuration)
+        traverse(default.getConfigurationManager(), '1').status = Active
 
         ts2 = TestService()
         default.setObject('test_service2', ts2)
         configuration = ServiceConfiguration(
             'test_service',
             '/++etc++Services/default/test_service2')
-        default['configure'].setObject('', configuration)
-        traverse(default, 'configure/2').status = Registered
+        default.getConfigurationManager().setObject('', configuration)
+        traverse(default.getConfigurationManager(), '2').status = Registered
 
         testOb = getService(self.rootFolder, 'test_service')
         self.assertEqual(testOb, ts1)
@@ -113,7 +113,8 @@
         self.testGetService() # set up localservice
 
         sm = traverse(self.rootFolder, '++etc++Services')
-        traverse(sm, 'default/configure/1').status = Unregistered
+        cm = traverse(sm, 'default').getConfigurationManager()
+        traverse(cm, '1').status = Unregistered
 
         self.assertEqual(getService(self.rootFolder, 'test_service'), root_ts)
 


=== Zope3/src/zope/app/services/tests/test_view.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/services/tests/test_view.py:1.7	Tue Mar 18 16:02:23 2003
+++ Zope3/src/zope/app/services/tests/test_view.py	Sun Mar 23 17:03:28 2003
@@ -128,7 +128,7 @@
 
         sm = traverse(self.rootFolder, '++etc++Services')
 
-        configure = traverse(sm, 'default/configure')
+        configure = traverse(sm, 'default').getConfigurationManager()
         configuration = Configuration()
         configure.setObject('', configuration)
         configuration = traverse(configure, '1')
@@ -163,7 +163,7 @@
 
         sm = traverse(self.rootFolder, '++etc++Services')
 
-        configure = traverse(sm, 'default/configure')
+        configure = traverse(sm, 'default').getConfigurationManager()
         configuration = Configuration()
         configure.setObject('', configuration)
         configuration = traverse(configure, '1')