def _build_run(self, name): mock_node = mock.create_autospec(node.Node) return ActionRun("id", name, mock_node, self.command, output_path=self.output_path)
def setup_action_run(self): self.output_path = filehandler.OutputPath(tempfile.mkdtemp()) self.action_runner = mock.create_autospec( actioncommand.NoActionRunnerFactory) self.command = "do command %(actionname)s" self.rendered_command = "do command action_name" self.action_run = ActionRun("id", "action_name", mock.create_autospec(node.Node), self.command, output_path=self.output_path, action_runner=self.action_runner)
def setup_action_run(self): self.output_path = filehandler.OutputPath(tempfile.mkdtemp()) self.action_runner = actioncommand.NoActionRunnerFactory() self.command = "do command {actionname}" self.rendered_command = "do command action_name" self.action_run = ActionRun( job_run_id="ns.id.0", name="action_name", node=mock.create_autospec(node.Node), bare_command=self.command, output_path=self.output_path, action_runner=self.action_runner, ) # These should be implemented in subclasses, we don't care here self.action_run.submit_command = mock.Mock() self.action_run.stop = mock.Mock() self.action_run.kill = mock.Mock()