def test_can_continue_workflow_should_fail(self): workflow_engine = InstanceWorkflowEngine(Mock(), Mock()) workflow_engine.status_cache[StatusConstants.SUCCESS] = Status( id=StatusConstants.SUCCESS, type=StatusTypes.SUCCESS) workflow_engine.status_cache[100] = Status(id=100, type=StatusTypes.FAILED) ok_(not workflow_engine._can_continue_workflow([ ActionInstance(status_id=100), ActionInstance(status_id=StatusConstants.SUCCESS) ]))
def test_can_continue_workflow_status_not_in_severity(self): workflow_engine = InstanceWorkflowEngine(Mock(), Mock()) workflow_engine.status_cache[StatusConstants.SUCCESS] = Status( id=StatusConstants.SUCCESS, type=StatusTypes.SUCCESS) workflow_engine.status_cache[100] = Status(id=100, type="semiborked") ok_( workflow_engine._can_continue_workflow([ ActionInstance(status_id=100), ActionInstance(status_id=StatusConstants.SUCCESS) ]))
def test_can_continue_workflow_should_continue_with_sliced_actions(self): workflow_engine = InstanceWorkflowEngine(Mock(), Mock()) workflow_engine.status_cache[StatusConstants.SUCCESS] = Status( id=StatusConstants.READY, type=StatusTypes.SUCCESS) workflow_engine.status_cache[100] = Status(id=100, type=StatusTypes.FAILED) ok_( workflow_engine._can_continue_workflow([ ActionInstance(status_id=100, slice='1/2', action_id=1), ActionInstance(status_id=StatusConstants.READY, slice='1/1', action_id=1) ]))