diff options
author | kotfu <kotfu@kotfu.net> | 2018-05-06 09:49:27 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-05-06 09:49:27 -0600 |
commit | bc3c31f182dd0d80192805fc1745a7e279afebff (patch) | |
tree | 261d6f4a4a0771b7189bfe80db91d1de9d8425d8 /tests/test_cmd2.py | |
parent | 529b783234f7721935c0e87a785c094784cb4fff (diff) | |
parent | bfdb482341efae823016ae7b1799cad06104309d (diff) | |
download | cmd2-git-bc3c31f182dd0d80192805fc1745a7e279afebff.tar.gz |
Merge branch 'master' into ignore_identchars
# Conflicts:
# cmd2/parsing.py
# tests/test_parsing.py
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 9dcfe692..c3c9a29f 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -1723,3 +1723,21 @@ def test_ppaged(base_app): base_app.ppaged(msg) out = base_app.stdout.buffer assert out == msg + end + +# we override cmd.parseline() so we always get consistent +# command parsing by parent methods we don't override +# don't need to test all the parsing logic here, because +# parseline just calls StatementParser.parse_command_only() +def test_parseline_empty(base_app): + statement = '' + command, args, line = base_app.parseline(statement) + assert not command + assert not args + assert not line + +def test_parseline(base_app): + statement = " command with 'partially completed quotes " + command, args, line = base_app.parseline(statement) + assert command == 'command' + assert args == "with 'partially completed quotes" + assert line == statement.strip() |