def test_module_launch(self): Result = shell_exec('python -m ec tests/targets simple/task1 arg1=1') self.checkResult(Result, Result['code'] == 0, Result['out'].strip().find('1 2') == 0, )
def test_exit_hook(self): Result = shell_exec('python tests/targets/allied.py t1 1') self.checkResult(Result, Result['code'] == 0, Result['out'].find(str(range(1, 10))) > -1, )
def test_entry_point_launch(self): Result = shell_exec('ec tests/targets simple/task1 arg1=1') self.checkResult(Result, Result['code'] == 0, Result['out'].strip().find('1 2') == 0, )
def launch_ec(argStr='', input='', flag=''): """Launches the targets dir. """ command = 'ec tests/targets' if flag: command += ' %s' % flag if argStr: command += ' simple/%s' % argStr return shell_exec(command, input=input)
def launch_ec(self, argStr='', input='', flag=''): r"""Dispatches command to ec (loaded as a module). """ command = 'python -m ec tests/targets/simple.py' if flag: command += ' %s' % flag if argStr: command += ' %s' % argStr return shell_exec(command, input=input)
def launch_ec(self, argStr='', input='', flag=''): r"""Dispatches command to the target script. """ command = 'ec tests/targets/simple.py' if flag: command += ' %s' % flag if argStr: command += ' %s' % argStr return shell_exec(command, input=input)
def launch_ec(self, argStr='', input='', flag=''): """Dispatches command to a nested script. """ command = 'python tests/targets/nester.py' if flag: command += ' %s' % flag if argStr: command += ' simple/%s' % argStr return shell_exec(command, input=input)
def launch_ec(*lines): """Passes commands through the shell. """ return shell_exec('python tests/targets/simple.py', input='%s\n\0' % '\r\n'.join(lines))