def job_run(self, tmpdir, mock_event_bus): action_foo = action.Action('foo', 'command', None) action_after_foo = action.Action('after_foo', 'command', None) action_bar = action.Action('bar', 'command', None, triggered_by={'trigger'}) action_graph = actiongraph.ActionGraph( action_map={ 'foo': action_foo, 'after_foo': action_after_foo, 'bar': action_bar, }, required_actions={'foo': set(), 'after_foo': {'foo'}, 'bar': set()}, required_triggers={'foo': set(), 'after_foo': set(), 'bar': {'trigger'}}, ) mock_job = mock.Mock( output_path=filehandler.OutputPath(tmpdir), action_graph=action_graph, action_runner=actioncommand.NoActionRunnerFactory(), ) job_run = jobrun.JobRun.for_job( mock_job, run_num=1, run_time=datetime.datetime.now(), node=mock.Mock(), manual=False, ) return job_run
def test__eq__(self): new_action = action.Action( self.action.name, self.action.command, self.node_pool, ) assert_equal(new_action, self.action)
def setup_action(self): self.node_pool = mock.create_autospec(node.NodePool) self.action = action.Action("my_action", "doit", self.node_pool)