summaryrefslogtreecommitdiff
path: root/tests/test_completion.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-04-02 12:55:49 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-04-02 12:55:49 -0400
commit880bdd1e33f6a11d441ae287cb062c7e72984d81 (patch)
tree5b9685f8c0e993161a3df6e4a1a679fc6e5e8fda /tests/test_completion.py
parent91a861dc35367a48d8a4cc33ac133f49bc185538 (diff)
downloadcmd2-git-880bdd1e33f6a11d441ae287cb062c7e72984d81.tar.gz
Added alias parse_line unit test
Diffstat (limited to 'tests/test_completion.py')
-rw-r--r--tests/test_completion.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py
index 69404aa7..a5cec508 100644
--- a/tests/test_completion.py
+++ b/tests/test_completion.py
@@ -627,6 +627,16 @@ def test_parseline_strips_line(cmd2_app):
assert args == 'history'
assert line.strip() == out_line
+def test_parseline_expands_alias(cmd2_app):
+ # Create the alias
+ cmd2_app.do_alias(['fake', 'pyscript'])
+
+ line = 'fake foobar.py'
+ command, args, out_line = cmd2_app.parseline(line)
+ assert command == 'pyscript'
+ assert args == 'foobar.py'
+ assert line.replace('fake', 'pyscript') == out_line
+
def test_parseline_expands_shortcuts(cmd2_app):
line = '!cat foobar.txt'
command, args, out_line = cmd2_app.parseline(line)