diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-15 23:37:10 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-07-15 23:37:10 -0400 |
commit | 1820ebe60a4d059b6f016041fe9b401758ae321e (patch) | |
tree | 51e7933c21af8fa5393024f99cdec702feb705a7 /tests/test_completion.py | |
parent | 94b424e9c41f99c6eb268c6c97f09e99a8342de8 (diff) | |
download | cmd2-git-1820ebe60a4d059b6f016041fe9b401758ae321e.tar.gz |
Renamed matches_sort_key to default_sort_key and using it to sort additional d
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 |