diff options
author | Marc Abramowitz <marc@marc-abramowitz.com> | 2014-05-11 22:44:09 -0700 |
---|---|---|
committer | Marc Abramowitz <marc@marc-abramowitz.com> | 2014-05-11 22:44:09 -0700 |
commit | d37e3d69bf0496828eaf140f16d53db5ae9c8c80 (patch) | |
tree | 91d3e7a2a421693f13d8e5cff3279936e774ae9f | |
parent | a3c4eb4a7c0f5128948e7346e900a5d79d85ecb0 (diff) | |
download | tox-d37e3d69bf0496828eaf140f16d53db5ae9c8c80.tar.gz |
Add test_posargs_backslashed_or_quoted
-rw-r--r-- | tests/test_config.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index b8d0aa3..c4ec9cc 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -663,6 +663,23 @@ class TestConfigTestEnv: assert argv[0] == ["cmd1", "[hello]", "world"] assert argv[1] == ["cmd1", "brave", "new", "world"] + def test_posargs_backslashed_or_quoted(self, tmpdir, newconfig): + inisource = """ + [testenv:py24] + commands = + echo "\{posargs\}" = {posargs} + echo "posargs = " "{posargs}" + """ + conf = newconfig([], inisource).envconfigs['py24'] + argv = conf.commands + assert argv[0] == ['echo', '\\{posargs\\}', '='] + assert argv[1] == ['echo', 'posargs ='] + + conf = newconfig(['dog', 'cat'], inisource).envconfigs['py24'] + argv = conf.commands + assert argv[0] == ['echo', '\\{posargs\\}', '=', 'dog', 'cat'] + assert argv[1] == ['echo', 'posargs =', 'dog', 'cat'] + def test_rewrite_posargs(self, tmpdir, newconfig): inisource = """ [testenv:py24] |