diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-08-22 17:20:03 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-08-22 17:20:03 +0100 |
commit | 81fab08682f9f442027021551403636943a0fa28 (patch) | |
tree | f30fc2926a65f8a2d30c17490d3ec725dbe8c7b6 /cmdtest | |
parent | 3440a71bc3a9193c6ce48f30c58055b74c7c3e1c (diff) | |
download | cmdtest-81fab08682f9f442027021551403636943a0fa28.tar.gz |
Run foo.script instead of using foo.args, when script exists.
Diffstat (limited to 'cmdtest')
-rwxr-xr-x | cmdtest | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -101,6 +101,7 @@ class CommandTester(cliapp.Application): def add_to_env(self): env = dict(os.environ) env['DATADIR'] = self.datadir + env['COMMAND'] = self.settings['command'] return env def run_test(self, test): @@ -108,9 +109,12 @@ class CommandTester(cliapp.Application): self.run_script(test.setup) - argv = [self.settings['command']] - if test.args: - argv.extend(self.expand(self.lines(test.args))) + if test.script: + argv = [test.script] + else: + argv = [self.settings['command']] + if test.args: + argv.extend(self.expand(self.lines(test.args))) stdin = self.cat(test.stdin or '/dev/null') exit, out, err = self.runcmd_unchecked(argv, |