diff options
author | holger krekel <holger@merlinux.eu> | 2013-10-14 12:04:28 +0200 |
---|---|---|
committer | holger krekel <holger@merlinux.eu> | 2013-10-14 12:04:28 +0200 |
commit | 3f91d072ccea26be752f7652b3c2d2354b40cb84 (patch) | |
tree | a7136f8cfcc44f21350781392519ade5f56017d1 /tests | |
parent | e4e41e26b07c13bcc7e7376479797e6748dde879 (diff) | |
download | tox-git-3f91d072ccea26be752f7652b3c2d2354b40cb84.tar.gz |
fix parsing/escaping bugs on windows32
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_config.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index e117ca0f..37767885 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -243,6 +243,16 @@ class TestIniParser: assert x == [["cmd1", "with space", "grr"], ["cmd2", "grr"]] + def test_argvlist_windows_escaping(self, tmpdir, newconfig): + config = newconfig(""" + [section] + comm = py.test {posargs} + """) + reader = IniReader(config._cfg) + reader.addsubstitutions([r"hello\this"]) + argv = reader.getargv("section", "comm") + assert argv == ["py.test", "hello\\this"] + def test_argvlist_multiline(self, tmpdir, newconfig): config = newconfig(""" [section] @@ -1077,3 +1087,15 @@ class TestCommandParser: p = CommandParser(cmd) parsed = list(p.words()) assert parsed == ['nosetests', ' ', '-v', ' ', '-a', ' ', '!deferred', ' ', '--with-doctest', ' ', '[]'] + +def test_argv_unquote_single_args(): + argv = ["hello", '"hello2"', "'hello3'"] + newargv = unquote_single_args(argv) + assert newargv == ["hello", "hello2", "hello3"] + +def test_argv_roundrobin(): + argv = ["hello", "this\\that"] + assert string2argv(argv2string(argv)) == argv + argv = ["hello world"] + assert string2argv(argv2string(argv)) == argv + |