diff options
Diffstat (limited to 'tests/test_completion.py')
-rw-r--r-- | tests/test_completion.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py index 1411cc49..3cee1955 100644 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -174,20 +174,20 @@ def test_complete_macro(base_app, request): assert first_match is not None and base_app.completion_matches == expected -def test_matches_sort_key(cmd2_app): +def test_default_sort_key(cmd2_app): text = '' line = 'test_sort_key {}'.format(text) endidx = len(line) begidx = endidx - len(text) # First do alphabetical sorting - cmd2_app.matches_sort_key = cmd2.cmd2.ALPHABETICAL_SORT_KEY + cmd2_app.default_sort_key = cmd2.cmd2.ALPHABETICAL_SORT_KEY expected = ['1', '11', '2'] first_match = complete_tester(text, line, begidx, endidx, cmd2_app) assert first_match is not None and cmd2_app.completion_matches == expected # Now switch to natural sorting - cmd2_app.matches_sort_key = cmd2.cmd2.NATURAL_SORT_KEY + cmd2_app.default_sort_key = cmd2.cmd2.NATURAL_SORT_KEY expected = ['1', '2', '11'] first_match = complete_tester(text, line, begidx, endidx, cmd2_app) assert first_match is not None and cmd2_app.completion_matches == expected |