def test_task_pos_arg(self): got = [] def py_callable(pos): got.append(pos) task = Task('Fake', [py_callable], pos_arg='pos') task.options = {} task.pos_arg_val = ['hi', 'there'] my_action = task.actions[0] my_action.execute() assert [['hi', 'there']] == got, repr(got)
def test_task_pos_arg(self): cmd = "%s %s/myecho.py" % (executable, TEST_PATH) cmd += " %(pos)s" task = Task('Fake', [cmd], pos_arg='pos') task.options = {} task.pos_arg_val = ['hi', 'there'] my_action = task.actions[0] assert my_action.execute() is None got = my_action.out.strip() assert "hi there" == got