Skip to content

Commit 880bdd1

Browse files
committed
Added alias parse_line unit test
1 parent 91a861d commit 880bdd1

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/test_completion.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,16 @@ def test_parseline_strips_line(cmd2_app):
627627
assert args == 'history'
628628
assert line.strip() == out_line
629629

630+
def test_parseline_expands_alias(cmd2_app):
631+
# Create the alias
632+
cmd2_app.do_alias(['fake', 'pyscript'])
633+
634+
line = 'fake foobar.py'
635+
command, args, out_line = cmd2_app.parseline(line)
636+
assert command == 'pyscript'
637+
assert args == 'foobar.py'
638+
assert line.replace('fake', 'pyscript') == out_line
639+
630640
def test_parseline_expands_shortcuts(cmd2_app):
631641
line = '!cat foobar.txt'
632642
command, args, out_line = cmd2_app.parseline(line)

0 commit comments

Comments
 (0)