[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/Workflow/tests - testWorkflowService.py:1.1.2.1
Vincenzo Di Somma
e.disomma@icube.it
Wed, 6 Mar 2002 05:49:55 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/Workflow/tests
In directory cvs.zope.org:/tmp/cvs-serv4731/tests
Added Files:
Tag: Zope-3x-branch
testWorkflowService.py
Log Message:
Workflow Service added
=== Added File Zope3/lib/python/Zope/App/Workflow/tests/testWorkflowService.py ===
import unittest
from Interface import Interface
class engineInterface(Interface):
pass
class dummyEngine:
__implements__ = engineInterface
def listActions( self ):
return [0, 1, 2]
class WorkflowService( unittest.TestCase ):
def createService( self ):
from Zope.App.Workflow.WorkflowService import WorkflowService
service = WorkflowService()
return service
def testInterface( self ):
from Zope.App.Workflow.IWorkflowService import IWorkflowService
from Zope.App.Workflow.WorkflowService import WorkflowService
from Interface.Verify import verifyClass
verifyClass( IWorkflowService, WorkflowService )
def testGetEngine( self ):
service = self.createService()
self.assertEqual(service.getEngine(engineInterface), [])
def testAddEngine( self ):
service = self.createService()
engine = dummyEngine()
service.addEngine(engine)
self.assertEqual(service.getEngine(engineInterface), [engine])
def testRemoveEngine( self ):
service = self.createService()
engine = dummyEngine()
service.addEngine(engine)
service.removeEngine(engine)
self.assertEqual(service.getEngine(engineInterface), [])
def testListWorkflowEngineActions( self ):
service = self.createService()
engine = dummyEngine()
service.addEngine(engine)
self.assertEqual(service.listWorkflowEngineActions(), engine.listActions())
if __name__ == '__main__':
unittest.main()