Ejemplo n.º 1
0
    def test_generate_tasks_after_run(self):
        rollout = Rollout({})
        rollout.save()
        create_task(rollout)
        rollout.rollout()

        self.assertRaises(Exception, rollout.generate_tasks)
Ejemplo n.º 2
0
    def test_single_task_rollback(self):
        rollout = Rollout({})
        rollout.save()
        root = create_task(rollout, TestTaskFail)

        rollout.rollout()

        self.assertRun(root)
        self.assertReverted(root)
Ejemplo n.º 3
0
    def test_single_task_rollout(self):
        rollout = Rollout({})
        rollout.save()
        root = create_task(rollout)

        rollout.rollout()

        self.assertRun(root)
        self.assertNotReverted(root)
Ejemplo n.º 4
0
    def _test_exec_rollout(self, exec_cls):
        rollout = Rollout({})
        rollout.save()
        task1 = create_task(rollout)
        task2 = create_task(rollout)
        task3 = create_task(rollout)
        task4 = create_task(rollout)
        root = create_task(rollout, exec_cls, [task1, task2, task3, task4])

        rollout.rollout()

        # Do not assert parents or root is run since otherwise we'd have to
        # override their call methods
        for task in task1, task2, task3, task4:
            self.assertRun(task)
            self.assertNotReverted(task)