[Zope-CVS] CVS: Packages3/workflow/tests - DummyProcessInstance.py:1.2 test_definition.py:1.2 test_instance.py:1.2
Ulrich Eck
ueck@net-labs.de
Wed, 5 Feb 2003 20:09:37 -0500
Update of /cvs-repository/Packages3/workflow/tests
In directory cvs.zope.org:/tmp/cvs-serv29874/tests
Modified Files:
DummyProcessInstance.py test_definition.py test_instance.py
Log Message:
- new ProcessDefinitionElementContainer
- extended tests
- Stateful ProcessDefinition/Instance:
+ basic functionality for Instance (getOutgoingTransitions/fireTransition)
- no relevant-data, conditions yet
- Added views for basic TTW interaction
=== Packages3/workflow/tests/DummyProcessInstance.py 1.1 => 1.2 ===
--- Packages3/workflow/tests/DummyProcessInstance.py:1.1 Tue Feb 4 16:39:27 2003
+++ Packages3/workflow/tests/DummyProcessInstance.py Wed Feb 5 20:09:34 2003
@@ -23,24 +23,18 @@
status = None
- def __init__(self, pd_name, initial_status):
+ def __init__(self, pd_name):
super(DummyProcessInstance, self).__init__()
- self._pd_name = pd_name
- self._status = initial_status
+ self.__pd_name = pd_name
+ self.__status = None
############################################################
# Implementation methods for interface
# zope.app.interfaces.workflow.IProcessInstance
- processDefinitionName = property(lambda self: self._pd_name)
+ processDefinitionName = property(lambda self: self.__pd_name)
- status = property(lambda self: self._status)
-
- def getWorkitems(self):
- return []
-
- def getWorkitem(self, wi_id):
- return None
+ status = property(lambda self: self.__status)
#
############################################################
=== Packages3/workflow/tests/test_definition.py 1.1 => 1.2 ===
--- Packages3/workflow/tests/test_definition.py:1.1 Tue Feb 4 16:39:27 2003
+++ Packages3/workflow/tests/test_definition.py Wed Feb 5 20:09:34 2003
@@ -20,6 +20,9 @@
from zope.app.interfaces.workflow import IProcessDefinition
from zope.app.workflow.definition import ProcessDefinition
+from zope.app.interfaces.workflow import IProcessDefinitionElementContainer
+from zope.app.workflow.definition import ProcessDefinitionElementContainer
+
class ProcessDefinitionTests(unittest.TestCase):
@@ -30,10 +33,23 @@
pd = ProcessDefinition()
pi = pd.createProcessInstance()
+
+
+from zope.app.container.tests.test_icontainer \
+ import Test as ContainerTests
+
+class ProcessDefinitionElementContainerTests(ContainerTests):
+
+ def testIProcessDefinitionElementContainer(self):
+ verifyClass(IProcessDefinitionElementContainer,
+ ProcessDefinitionElementContainer)
+
+
+
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(
- ProcessDefinitionTests))
+ ProcessDefinitionTests, ProcessDefinitionElementContainerTests))
return suite
if __name__ == '__main__':
=== Packages3/workflow/tests/test_instance.py 1.1 => 1.2 ===
--- Packages3/workflow/tests/test_instance.py:1.1 Tue Feb 4 16:39:27 2003
+++ Packages3/workflow/tests/test_instance.py Wed Feb 5 20:09:34 2003
@@ -17,20 +17,30 @@
from zope.interface.verify import verifyClass
from zope.app.interfaces.workflow import IProcessInstance
-from zope.app.workflow.tests.DummyProcessInstance \
- import DummyProcessInstance
+from zope.app.workflow.instance import ProcessInstance
+
+from zope.app.interfaces.workflow import IProcessInstanceContainer
+from zope.app.workflow.instance import ProcessInstanceContainerAdapter
class ProcessInstanceTests(unittest.TestCase):
def testInterface(self):
- verifyClass(IProcessInstance, DummyProcessInstance)
+ verifyClass(IProcessInstance, ProcessInstance)
+
+
+
+class ProcessInstanceContainerAdapterTests(unittest.TestCase):
+
+ def testInterface(self):
+ verifyClass(IProcessInstanceContainer,
+ ProcessInstanceContainerAdapter)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(
- ProcessInstanceTests))
+ ProcessInstanceTests, ProcessInstanceContainerAdapterTests))
return suite
if __name__ == '__main__':