summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-08-15 20:29:26 +0100
committerLars Wirzenius <liw@liw.fi>2011-08-15 20:29:26 +0100
commit8c7feeb95a407abaeccbcac02175891fea14a19a (patch)
tree3f4b5dcfeb641540a9e912ae62069d4ada8b5a9d
parentda6cba614a433a39e83d704fcf5ca7d108c8ffb8 (diff)
downloadcmdtest-8c7feeb95a407abaeccbcac02175891fea14a19a.tar.gz
Document (and fix) args format and variable expansion.
-rw-r--r--README4
-rwxr-xr-xcmdtest2
2 files changed, 5 insertions, 1 deletions
diff --git a/README b/README
index 6411733..7ab533e 100644
--- a/README
+++ b/README
@@ -13,6 +13,7 @@ standard output.
Each test case consists of:
* a set of command line arguments, not including the command name (`foo.args`)
+ - each argument is on its own line
* the file fed to standard input (`foo.stdin`)
* the expected output to the standard output (`foo.stdout`)
* the expected output to the standard error (`foo.stderr`)
@@ -60,4 +61,7 @@ The shell scripts may use the following environment variables:
* `DATADIR`: a temporary directory where files may be created by the test
+In addition, the `foo.args` files can use Pythonic string expansion:
+
+* `%(datadir)s` for the same value as `$DATADIR`
diff --git a/cmdtest b/cmdtest
index c7e616e..b4d797a 100755
--- a/cmdtest
+++ b/cmdtest
@@ -147,7 +147,7 @@ class CommandTester(cliapp.Application):
def expand(self, strings):
variables = {
- 'tempdir': self.tempdir,
+ 'datadir': self.datadir,
}
return [s % variables for s in strings]