示例#1
0
 def run_command(self, command):
     """convenience helper so we don't forget to include cwd.
     :param command the command to be executed."""
     if not isinstance(command, list):
         raise ValueError("Expected list for Testrun.run_command, not %s" %
                          str(type(command)))
     return run_command(command, cwd=self.test_dir)
示例#2
0
 def run(self, run_args, **kwargs):
     use_command = run_args \
         if isinstance(run_args, list) \
         else run_args.split(" ")
     full_command = self.base_command + use_command
     # call(*a1, *a2) seems only to work on python 3.5+
     return tools.run_command(full_command,
                              **tools.deep_merge(self.run_kwargs, kwargs))
 def run(self, run_args, **kwargs):
     use_command = run_args \
         if isinstance(run_args, list) \
         else run_args.split(" ")
     full_command = self.base_command + use_command
     # call(*a1, *a2) seems only to work on python 3.5+
     return tools.run_command(full_command,
                              **tools.deep_merge(self.run_kwargs, kwargs))
示例#4
0
 def _run_local_commands(self, commands):
     """
     Executes a list of commands on the local machine (pre- and post-
     commands, intendedly.
     :param commands: The commands to execute
     :return: A list with the return objects.
     """
     if not commands:
         return
     rvs = []
     for command in _build_exec_array(commands):
         rvs.append(run_command(command,
                                throw=True,
                                env=dict(os.environ,
                                         **self.test_env)))
     return rvs
示例#5
0
 def _run_local_commands(self, commands):
     """
     Executes a list of commands on the local machine (pre- and post-
     commands, intendedly.
     :param commands: The commands to execute
     :return: A list with the return objects.
     """
     if not commands:
         return
     rvs = []
     for command in _build_exec_array(commands):
         rvs.append(run_command(command,
                                throw=True,
                                env=dict(os.environ,
                                         **self.test_env)))
     return rvs