Ejemplo n.º 1
0
    def test_prepend_task_empty_relations(self):
        task_1 = Task(task_id=TEST_MAPPER_NAME + "_1", template_name="pig.tpl")
        task_2 = Task(task_id=TEST_MAPPER_NAME + "_2", template_name="pig.tpl")

        tasks, relations = ActionMapper.prepend_task(task_to_prepend=task_1,
                                                     tasks=[task_2],
                                                     relations=[])
        self.assertEqual([task_1, task_2], tasks)
        self.assertEqual([
            Relation(from_task_id="mapper_name_1", to_task_id="mapper_name_2")
        ], relations)
Ejemplo n.º 2
0
 def test_prepend_task_no_tasks(self):
     task_1 = Task(task_id=TEST_MAPPER_NAME + "_1", template_name="pig.tpl")
     with self.assertRaises(IndexError):
         ActionMapper.prepend_task(task_to_prepend=task_1,
                                   tasks=[],
                                   relations=[])