def setup_runs(self): action_names = ['action_name', 'second_name', 'cleanup'] action_graph = [ mock.Mock(name=name, required_actions=[]) for name in action_names ] self.action_graph = actiongraph.ActionGraph( action_graph, dict((a.name, a) for a in action_graph)) self.output_path = filehandler.OutputPath(tempfile.mkdtemp()) self.command = "do command" self.action_runs = [self._build_run(name) for name in action_names] self.run_map = dict((a.action_name, a) for a in self.action_runs) self.run_map['cleanup'].is_cleanup = True self.collection = ActionRunCollection(self.action_graph, self.run_map)
def setup_collection(self): action_names = ['action_name', 'second_name', 'cleanup'] action_graph = [ Turtle(name=name, required_actions=[]) for name in action_names ] self.second_act = second_act = action_graph.pop(1) second_act.required_actions.append(action_graph[0]) action_map = dict((a.name, a) for a in action_graph) action_map['second_name'] = second_act self.action_graph = actiongraph.ActionGraph(action_graph, action_map) self.output_path = filehandler.OutputPath(tempfile.mkdtemp()) self.command = "do command" self.action_runs = [self._build_run(name) for name in action_names] self.run_map = dict((a.action_name, a) for a in self.action_runs) self.run_map['cleanup'].is_cleanup = True self.collection = ActionRunCollection(self.action_graph, self.run_map)