def test_logbook_add_workflow(self): db_api.workflow_create('', u'workflow_10') self.wf_ids.append(10) self.wf_names.append(u'workflow_10') expected = self.wf_ids actual = [] temp = db_api.logbook_add_workflow('', 1, u'workflow_10') for workflow in temp: actual.append(workflow.id) self.assertEquals(expected, actual) self.assertRaises(exception.NotFound, db_api.logbook_add_workflow, '', 9001, u'workflow_10') self.assertRaises(exception.NotFound, db_api.logbook_add_workflow, '', 1, u'workflow_9001')
def test_workflow_create(self): id = 0 while (self.wf_ids.count(id) > 0): id = id + 1 wf_tmp = db_api.workflow_create('', u'workflow_{0}'.format(id)) self.wf_ids.append(id) self.wf_names.append(u'workflow_{0}'.format(id)) self.assertIsNotNone(db_api.workflow_get('', u'workflow_{0}'.format(id)))
def test_workflow_create(self): id = 0 while (self.wf_ids.count(id) > 0): id = id + 1 wf_tmp = db_api.workflow_create('', u'workflow_{0}'.format(id)) self.wf_ids.append(id) self.wf_names.append(u'workflow_{0}'.format(id)) self.assertIsNotNone( db_api.workflow_get('', u'workflow_{0}'.format(id)))
def setUpClass(cls): wf_fmt = u'workflow_{0}' lb_tmp = db_api.logbook_create('', u'logbook_1', 1) cls.lb_ids.append(1) cls.lb_names.append(u'logbook_1') for i in range(1, 10): wf_tmp = db_api.workflow_create('', wf_fmt.format(i)) db_api.logbook_add_workflow('', 1, wf_fmt.format(i)) cls.wf_ids.append(i) cls.wf_names.append(wf_fmt.format(i))
def setUpClass(cls): wf_fmt = u'workflow_{0}' tsk_fmt = u'task_{0}' for i in range(1, 10): wf_tmp = db_api.workflow_create('', wf_fmt.format(i)) tsk_tmp = db_api.task_create('', tsk_fmt.format(i), i, i) db_api.workflow_add_task('', wf_fmt.format(i), i) cls.tsk_ids.append(i) cls.tsk_names.append(tsk_fmt.format(i)) cls.wf_ids.append(i) cls.wf_names.append(wf_fmt.format(i))