Exemple #1
0
 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
Exemple #2
0
 def test__eq__(self):
     new_action = action.Action(
         self.action.name,
         self.action.command,
         self.node_pool,
     )
     assert_equal(new_action, self.action)
Exemple #3
0
 def setup_action(self):
     self.node_pool = mock.create_autospec(node.NodePool)
     self.action = action.Action("my_action", "doit", self.node_pool)