コード例 #1
0
    def test_workflow_get_tasks(self):
        expected = [self.tsk_names[0], self.tsk_names[9]]
        actual = []
        temp = db_api.workflow_get_tasks('', u'workflow_1')

        for task in temp:
            actual.append(task.name)

        self.assertEquals(expected, actual)

        self.assertRaises(exception.NotFound, db_api.workflow_get_tasks, '',
                          u'workflow_9001')
コード例 #2
0
    def test_workflow_get_tasks(self):
        expected = [self.tsk_names[0], self.tsk_names[9]]
        actual = []
        temp = db_api.workflow_get_tasks('', u'workflow_1')

        for task in temp:
            actual.append(task.name)

        self.assertEquals(expected, actual)

        self.assertRaises(exception.NotFound, db_api.workflow_get_tasks, '',
                          u'workflow_9001')
コード例 #3
0
    def test_workflow_add_task(self):
        tsk_tmp = db_api.task_create('', u'task_10', 1, 10)
        db_api.workflow_add_task('', u'workflow_1', 10)
        self.tsk_ids.append(10)
        self.tsk_names.append('task_10')
        expected = [self.tsk_names[0], self.tsk_names[9]]
        tsks = db_api.workflow_get_tasks('', u'workflow_1')
        actual = [tsks[0].name, tsks[1].name]

        self.assertEquals(expected, actual)

        self.assertRaises(exception.NotFound, db_api.workflow_add_task, '',
                          u'workflow_9001', 10)
        self.assertRaises(exception.NotFound, db_api.workflow_add_task, '',
                          u'workflow_1', 9001)
コード例 #4
0
    def test_workflow_add_task(self):
        tsk_tmp = db_api.task_create('', u'task_10', 1, 10)
        db_api.workflow_add_task('', u'workflow_1', 10)
        self.tsk_ids.append(10)
        self.tsk_names.append('task_10')
        expected = [self.tsk_names[0], self.tsk_names[9]]
        tsks = db_api.workflow_get_tasks('', u'workflow_1')
        actual = [tsks[0].name, tsks[1].name]

        self.assertEquals(expected, actual)

        self.assertRaises(exception.NotFound, db_api.workflow_add_task, '',
                          u'workflow_9001', 10)
        self.assertRaises(exception.NotFound, db_api.workflow_add_task, '',
                          u'workflow_1', 9001)