[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/tests - test_service.py:1.4 workflowsetup.py:1.5

Steve Alexander steve@cat-box.net
Thu, 5 Jun 2003 08:03:51 -0400


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

Modified Files:
	test_service.py workflowsetup.py 
Log Message:
Placeful setup for tests now sets up a  ZopeContainerDecorator.
This means that in such tests, you no longer need to use
ZopeContainerAdapter to get the correct events issued, and perform context-
wrapping duties, when you use a container.
However, it does mean that your tests need to expect these events and
context-wrappers to be used.



=== Zope3/src/zope/app/workflow/tests/test_service.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/workflow/tests/test_service.py:1.3	Tue Jun  3 18:46:24 2003
+++ Zope3/src/zope/app/workflow/tests/test_service.py	Thu Jun  5 08:03:20 2003
@@ -25,7 +25,7 @@
 
 from zope.app.interfaces.annotation import IAttributeAnnotatable
 from zope.app.interfaces.services.configuration import IUseConfigurable
-
+from zope.app.interfaces.services.configuration import IUseConfiguration
 from zope.app.interfaces.services.configuration import Active, Registered
 
 from zope.app.workflow.tests.workflowsetup import WorkflowSetup
@@ -36,7 +36,8 @@
 
 # define and create dummy ProcessDefinition (PD) for tests
 class DummyProcessDefinition:
-    implements(IProcessDefinition, IAttributeAnnotatable, IUseConfigurable)
+    implements(IProcessDefinition, IAttributeAnnotatable, IUseConfigurable,
+               IUseConfiguration)
 
     def __init__(self, n):
         self.n = n
@@ -46,6 +47,12 @@
 
     def createProcessInstance(self, definition_name):
         return 'PI #%d' % self.n
+
+    # Implements (incompletely) IUseConfiguration to satisfy the promise that
+    # it is IUseConfigurable.
+    # Only the method addUsage is implemented.
+    def addUsage(self, location):
+        pass
 
 
 def sort(l):


=== Zope3/src/zope/app/workflow/tests/workflowsetup.py 1.4 => 1.5 ===
--- Zope3/src/zope/app/workflow/tests/workflowsetup.py:1.4	Tue Jun  3 18:46:24 2003
+++ Zope3/src/zope/app/workflow/tests/workflowsetup.py	Thu Jun  5 08:03:20 2003
@@ -53,13 +53,13 @@
                                         WorkflowServiceForTests())
         self.default = zapi.traverse(self.sm, "default")
         self.cm = self.default.getConfigurationManager()
-        
+
         self.sm1 = self.makeSite('folder1')
         self.service1 = setup.addService(self.sm1, Workflows,
                                          WorkflowServiceForTests())
         self.default1 = zapi.traverse(self.sm1, "default")
         self.cm1 = self.default1.getConfigurationManager()
-        
+
     def setupAuthService(self):
         self.root_sm.defineService(Authentication, IAuthenticationService)
         self.root_sm.provideService(Authentication, principalRegistry)