diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-17 11:04:10 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-17 11:04:10 -0400 |
commit | 83a28727d012ab067d18d89d3b1ce6410459f67b (patch) | |
tree | b9af6a1670943c4eadcd866c4a9e7de0bc6342ba /tests/test_parsing.py | |
parent | 47dce297681f799c51a65b3e8420bf0c551c779b (diff) | |
download | cmd2-git-83a28727d012ab067d18d89d3b1ce6410459f67b.tar.gz |
Made unit test more correct
Diffstat (limited to 'tests/test_parsing.py')
-rw-r--r-- | tests/test_parsing.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/test_parsing.py b/tests/test_parsing.py index 8cea3305..5852309e 100644 --- a/tests/test_parsing.py +++ b/tests/test_parsing.py @@ -12,7 +12,7 @@ import pytest import cmd2 from cmd2 import constants, utils from cmd2.constants import MULTILINE_TERMINATOR -from cmd2.parsing import StatementParser +from cmd2.parsing import StatementParser, shlex_split @pytest.fixture def parser(): @@ -210,7 +210,7 @@ def test_parse_embedded_comment_char(parser): assert statement.command == 'hi' assert statement == constants.COMMENT_CHAR + ' not a comment' assert statement.args == statement - assert statement.argv == command_str.split() + assert statement.argv == shlex_split(command_str) assert statement.arg_list == statement.argv[1:] @pytest.mark.parametrize('line',[ @@ -478,9 +478,10 @@ def test_parse_alias_and_shortcut_expansion(parser, line, command, args): assert statement.args == statement # Now allow no expansion + tokens = shlex_split(line) statement = parser.parse(line, expand=False) - assert statement.command == line.split()[0] - assert statement.split() == line.split()[1:] + assert statement.command == tokens[0] + assert shlex_split(statement) == tokens[1:] assert statement.args == statement def test_parse_alias_on_multiline_command(parser): |