From 83a28727d012ab067d18d89d3b1ce6410459f67b Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Sun, 17 Mar 2019 11:04:10 -0400 Subject: Made unit test more correct --- tests/test_parsing.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/test_parsing.py') 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): -- cgit v1.2.1