Beispiel #1
0
 def test_fast_workflow_runner(self):
     w = Workflow.objects.get(name='For loop test')
     wr = WorkflowRunner(w)
     wr.run()
     wid = Widget.objects.get(id=6)
     o = wid.outputs.all()[0].value
     self.assertEqual(o, [20, 40, 60, 80])
Beispiel #2
0
 def test_fast_workflow_runner(self):
     w = Workflow.objects.get(name='For loop test')
     wr = WorkflowRunner(w)
     wr.run()
     wid = Widget.objects.get(id=6)
     o = wid.outputs.all()[0].value
     self.assertEqual(o,[20,40,60,80])
Beispiel #3
0
 def test_fast_workflow_runner_cv(self):
     w = Workflow.objects.get(name='Cross test')
     wr = WorkflowRunner(w)
     wr.run()
     wid = Widget.objects.get(id=16)
     o = wid.outputs.all()[0].value
     self.assertEqual(
         o, [[[[u'2'], [u'1']], [u'3'], 1], [[[u'3'], [u'1']], [u'2'], 1],
             [[[u'3'], [u'2']], [u'1'], 1]])
Beispiel #4
0
 def test_fast_workflow_runner_cv(self):
     w = Workflow.objects.get(name='Cross test')
     wr = WorkflowRunner(w)
     wr.run()
     wid = Widget.objects.get(id=16)
     o = wid.outputs.all()[0].value
     self.assertEqual(o,[[[[u'2'], [u'1']], [u'3'], 1],
                         [[[u'3'], [u'1']], [u'2'], 1],
                         [[[u'3'], [u'2']], [u'1'], 1]])
Beispiel #5
0
 def test_fast_widget_runner(self):
     w = Widget.objects.get(id=6)
     wr = WidgetRunner(w,
                       workflow_runner=WorkflowRunner(w.workflow,
                                                      clean=False),
                       standalone=True)
     wr.run()
     wid = Widget.objects.get(id=6)
     o = wid.outputs.all()[0].value
     self.assertEqual(o, [20, 40, 60, 80])
Beispiel #6
0
 def test_fast_widget_runner_cv(self):
     w = Widget.objects.get(id=16)
     wr = WidgetRunner(w,
                       workflow_runner=WorkflowRunner(w.workflow,
                                                      clean=False),
                       standalone=True)
     wr.run()
     wid = Widget.objects.get(id=16)
     o = wid.outputs.all()[0].value
     self.assertEqual(
         o, [[[[u'2'], [u'1']], [u'3'], 1], [[[u'3'], [u'1']], [u'2'], 1],
             [[[u'3'], [u'2']], [u'1'], 1]])
 def run(self, request, pk=None):
     workflow = self.get_object()
     try:
         WorkflowRunner(workflow).run()
     except EnvironmentError:  #temp
         return HttpResponse(json.dumps({
             'status':
             'error',
             'message':
             'Problem running workflow'
         }),
                             content_type="application/json")
     return HttpResponse(json.dumps({'status': 'ok'}),
                         content_type="application/json")
Beispiel #8
0
 def run(self):
     from workflows.engine import WorkflowRunner
     WorkflowRunner(self.workflow,
                    final_widget=self).run()  #run with ancestors