diff options
| author | Chris Rose <offby1@offby1.net> | 2011-01-09 10:21:13 -0700 |
|---|---|---|
| committer | Chris Rose <offby1@offby1.net> | 2011-01-09 10:21:13 -0700 |
| commit | 5e8179998d8e5db9cda9c6d34e80512f4a2b395d (patch) | |
| tree | 3b062f0108853c2893bd2fe613ba3cc29d037c97 | |
| parent | 21358f60c0fffa4fde430f8386b0c053ac5ac8b3 (diff) | |
| download | tox-5e8179998d8e5db9cda9c6d34e80512f4a2b395d.tar.gz | |
Test for the handling of quoted whitespace in config parsing
| -rw-r--r-- | tests/test_config.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_config.py b/tests/test_config.py index 3ad22ef..c5438c3 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -183,6 +183,18 @@ class TestIniParser: assert x == [["cmd1", "with space", "grr"]] + def test_argvlist_quoting_in_command(self, tmpdir, newconfig): + config = newconfig(""" + [section] + key1= + cmd1 'with space' \ # a comment + 'after the comment' + """) + reader = IniReader(config._cfg) + x = reader.getargvlist("section", "key1") + assert x == [["cmd1", "with space", "after the comment"]] + + def test_argvlist_positional_substitution(self, tmpdir, newconfig): config = newconfig(""" [section] @@ -650,3 +662,9 @@ class TestCommandParser: p = CommandParser(cmd) parsed = list(p.words()) assert parsed == ['cmd2', '{posargs:{item2} other}'] + + def test_command_parsing_for_issue_10(self): + cmd = "nosetests -v -a !deferred --with-doctest []" + p = CommandParser(cmd) + parsed = list(p.words()) + assert parsed == ['nosetests', '-v', '-a', '!deferred', '--with-doctest', '[]'] |
