[Zope-CVS] CVS: Packages3/workflow/tests - test_service.py:1.4 workflowsetup.py:1.4
Ulrich Eck
ueck@net-labs.de
Mon, 24 Mar 2003 09:52:35 -0500
Update of /cvs-repository/Packages3/workflow/tests
In directory cvs.zope.org:/tmp/cvs-serv19501
Modified Files:
test_service.py workflowsetup.py
Log Message:
updates for ++etc++site /ConfigurationManager changes
=== Packages3/workflow/tests/test_service.py 1.3 => 1.4 ===
--- Packages3/workflow/tests/test_service.py:1.3 Wed Mar 19 12:00:43 2003
+++ Packages3/workflow/tests/test_service.py Mon Mar 24 09:52:34 2003
@@ -65,14 +65,14 @@
self.default.setObject('pd2', DummyProcessDefinition(2))
self.cm.setObject('', ProcessDefinitionConfiguration('definition1',
- '/++etc++Services/Packages/default/pd1'))
- traverse(self.default, 'configure/2').status = Active
+ '/++etc++site/default/pd1'))
+ traverse(self.default.getConfigurationManager(), '2').status = Active
self.cm.setObject('', ProcessDefinitionConfiguration('definition2',
- '/++etc++Services/Packages/default/pd2'))
- traverse(self.default, 'configure/3').status = Active
+ '/++etc++site/default/pd2'))
+ traverse(self.default.getConfigurationManager(), '3').status = Active
self.cm.setObject('', ProcessDefinitionConfiguration('definition3',
- '/++etc++Services/Packages/default/pd1'))
- traverse(self.default, 'configure/4').status = Registered
+ '/++etc++site/default/pd1'))
+ traverse(self.default.getConfigurationManager(), '4').status = Registered
# Now self.service has definition1 and definition2 available
# and knows about definition3
@@ -80,11 +80,11 @@
self.default1.setObject('pd4', DummyProcessDefinition(4))
self.cm1.setObject('', ProcessDefinitionConfiguration('definition1',
- '/folder1/++etc++Services/Packages/default/pd3'))
- traverse(self.default1, 'configure/2').status = Active
+ '/folder1/++etc++site/default/pd3'))
+ traverse(self.default1.getConfigurationManager(), '2').status = Active
self.cm1.setObject('', ProcessDefinitionConfiguration('definition4',
- '/folder1/++etc++Services/Packages/default/pd4'))
- traverse(self.default1, 'configure/3').status = Active
+ '/folder1/++etc++site/default/pd4'))
+ traverse(self.default1.getConfigurationManager(), '3').status = Active
# Now self.service1 overrides definition1, adds new definition4 available,
# and inherits definition2 from self.service
=== Packages3/workflow/tests/workflowsetup.py 1.3 => 1.4 ===
--- Packages3/workflow/tests/workflowsetup.py:1.3 Wed Mar 19 12:00:43 2003
+++ Packages3/workflow/tests/workflowsetup.py Mon Mar 24 09:52:34 2003
@@ -16,7 +16,7 @@
Revision information:
$Id$
"""
-from zope.app.traversing import traverse
+from zope.app.traversing import traverse, getPath
from zope.app.container.zopecontainer import ZopeContainerAdapter
from zope.app.services.service import ServiceManager
from zope.app.services.service import ServiceConfiguration
@@ -78,30 +78,35 @@
self.buildFolders()
self.rootFolder.setServiceManager(ServiceManager())
- self.sm = traverse(self.rootFolder, '++etc++Services')
-
- self.default = traverse(self.rootFolder,
- '++etc++Services/Packages/default')
- self.default.setObject('workflow_srv', WorkflowServiceForTests())
- self.service = traverse(self.default, 'workflow_srv')
-
- self.cm = ZopeContainerAdapter(traverse(self.default, "configure"))
- self.cm.setObject('', ServiceConfiguration(Workflows,
- '/++etc++Services/Packages/default/workflow_srv'))
- traverse(self.default, 'configure/1').status = Active
+ service_name = 'workflow_srv'
+ self.sm = traverse(self.rootFolder, '++etc++site')
+ self.default = default = traverse(self.sm, 'default')
+ default.setObject(service_name, WorkflowServiceForTests())
+
+ # XXX change to unique names
+ self.service = traverse(default, service_name)
+ path = "%s/%s" % (getPath(default), service_name)
+ configuration = ServiceConfiguration(Workflows, path, self.rootFolder)
+ self.cm = default.getConfigurationManager()
+ self.cm.setObject('', configuration)
+ traverse(self.cm, '1').status = Active
# Set up a more local workflow service
folder1 = traverse(self.rootFolder, 'folder1')
folder1.setServiceManager(ServiceManager())
- self.default1 = traverse(folder1, '++etc++Services/Packages/default')
- self.default1.setObject('workflow_srv1', WorkflowServiceForTests())
- self.service1 = traverse(self.default1, 'workflow_srv1')
-
- self.cm1 = ZopeContainerAdapter(traverse(self.default1, "configure"))
- self.cm1.setObject('', ServiceConfiguration(Workflows,
- '/folder1/++etc++Services/Packages/default/workflow_srv1'))
- traverse(self.default1, 'configure/1').status = Active
+ service_name1 = 'workflow_srv1'
+ self.sm1 = traverse(folder1, '++etc++site')
+ self.default1 = default1 = traverse(self.sm1, 'default')
+ default1.setObject(service_name1, WorkflowServiceForTests())
+
+ # XXX change to unique name
+ self.service1 = traverse(self.default1, service_name1)
+ path1 = "%s/%s" % (getPath(default1), service_name1)
+ configuration1 = ServiceConfiguration(Workflows, path1, self.rootFolder)
+ self.cm1 = default1.getConfigurationManager()
+ self.cm1.setObject('', configuration1)
+ traverse(self.cm1, '1').status = Active
def setupAuthService(self):
@@ -121,3 +126,4 @@
return getService(self.rootFolder, Permissions)
+