Permalink
Browse files

better comparison for workflows

  • Loading branch information...
1 parent e5add21 commit c009a0a48a66d6fb0c6ccd3b51b20200fdb58655 @sigma sigma committed Nov 7, 2010
Showing with 16 additions and 10 deletions.
  1. +16 −10 tests/test_getallworkflows.py
@@ -25,23 +25,29 @@ def _testWorkflowsBase(self, params):
self.assertTrue(isinstance(wf, Workflow))
return wfs
+ def _compareWorkflow(self, wf, wf_def):
+ self.assertEquals(wf_def['name'], wf.name)
+ self.assertEquals(wf_def['description'], wf.description)
+ self.assertEquals(wf_def['id'], wf.id)
+
def testNoWorkflow(self):
_params = {'workflows': []}
self._testWorkflowsBase(_params)
def testMinimalWorkflow(self):
_params = {'workflows': [{'name': "Plop"}]}
- self._testWorkflowsBase(_params)
+ wfs = self._testWorkflowsBase(_params)
+ self.assertEquals(len(wfs), 1)
+ self.assertEquals(wfs[0].name, "Plop")
def testCompleteWorkflow(self):
- _params = {'workflows': [{'name': "Plop",
- 'description': "dummy workflow",
- 'id': "12345-67890",
- 'input': [{'name': "in1",
- 'type': "type1"}],
- 'output': [{'name': "out1",
- 'type': "type1"}],
- 'attributes': [{'name': "attr1",
- 'type': "type1"}]}]}
+ wf0 = {'name': "Plop",
+ 'description': "dummy workflow",
+ 'id': "12345-67890",
+ 'input': [{'name': "in1", 'type': "type1"}],
+ 'output': [{'name': "out1", 'type': "type1"}],
+ 'attributes': [{'name': "attr1", 'type': "type1"}]}
+ _params = {'workflows': [wf0]}
wfs = self._testWorkflowsBase(_params)
self.assertEquals(len(wfs), 1)
+ self._compareWorkflow(wfs[0], wf0)

0 comments on commit c009a0a

Please sign in to comment.