[Zope3-checkins] CVS: Zope3/src/zope/app/workflow/stateful/tests - test_contentworkflow.py:1.18

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Apr 15 18:11:41 EDT 2004


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

Modified Files:
	test_contentworkflow.py 
Log Message:


Got rid of workflow service.



Added DummyProcessDefinition which was previously defined in the service tests.


=== Zope3/src/zope/app/workflow/stateful/tests/test_contentworkflow.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/workflow/stateful/tests/test_contentworkflow.py:1.17	Sat Mar 13 18:55:31 2004
+++ Zope3/src/zope/app/workflow/stateful/tests/test_contentworkflow.py	Thu Apr 15 18:11:40 2004
@@ -22,14 +22,17 @@
 from zope.interface.verify import verifyClass
 
 from zope.app import zapi
+from zope.app.annotation.interfaces import IAttributeAnnotatable
+from zope.app.container.contained import Contained
 from zope.app.event.objectevent import ObjectCreatedEvent
-from zope.app.event.tests.placelesssetup import \
-     eventPublisher, EventRecorder, clearEvents
+from zope.app.event.tests.placelesssetup import eventPublisher, EventRecorder
+from zope.app.event.tests.placelesssetup import clearEvents
 from zope.app.annotation.interfaces import IAnnotatable, IAttributeAnnotatable
 from zope.app.event.interfaces import IObjectCreatedEvent, ISubscriptionService
 from zope.app.event.localservice import EventService
 from zope.app.servicenames import EventSubscription
 from zope.app.utility import UtilityRegistration
+from zope.app.utility.interfaces import ILocalUtility
 from zope.app.registration.interfaces import ActiveStatus
 
 from zope.app.workflow.interfaces import IProcessDefinition
@@ -39,10 +42,27 @@
 from zope.app.workflow.instance import ProcessInstanceContainerAdapter
 from zope.app.workflow.stateful.contentworkflow import ContentWorkflowsManager
 from zope.app.workflow.tests.workflowsetup import WorkflowSetup
-from zope.app.workflow.tests.test_service import DummyProcessDefinition
 
 from zope.app.tests import ztapi, setup
 
+# define and create dummy ProcessDefinition (PD) for tests
+class DummyProcessDefinition(Contained):
+    implements(IProcessDefinition, IAttributeAnnotatable, ILocalUtility)
+
+    def __init__(self, n):
+        self.n = n
+
+    def __str__(self):
+        return'PD #%d' % self.n
+
+    def createProcessInstance(self, definition_name):
+        return 'PI #%d' % self.n
+
+    # Implements (incompletely) IRegistered to satisfy the promise that
+    # it is IRegisterable.
+    # Only the method addUsage is implemented.
+    def addUsage(self, location):
+        pass
 
 class IFace1(Interface):
     pass




More information about the Zope3-Checkins mailing list