summaryrefslogtreecommitdiff
path: root/tests/test_completion.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-08-04 08:14:42 -0700
committerGitHub <noreply@github.com>2018-08-04 08:14:42 -0700
commitb7e265e547a85adc080f6778eb80b57ff4bad2b6 (patch)
tree855899a28ea0d8cb351a01cf30b3c5873dff745b /tests/test_completion.py
parent6cff4b2cb70ba41d6b90a39c829043efa195eec9 (diff)
parent94a7c993f1d251d066f15439c08992871325813d (diff)
downloadcmd2-git-b7e265e547a85adc080f6778eb80b57ff4bad2b6.tar.gz
Merge branch 'master' into module_index
Diffstat (limited to 'tests/test_completion.py')
-rw-r--r--tests/test_completion.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py
index 2faa4a08..00a120cc 100644
--- a/tests/test_completion.py
+++ b/tests/test_completion.py
@@ -14,6 +14,7 @@ import sys
import pytest
import cmd2
+from cmd2 import utils
from .conftest import complete_tester, StdOut
from examples.subcommands import SubcommandsExample
@@ -251,7 +252,7 @@ def test_path_completion_multiple(cmd2_app, request):
endidx = len(line)
begidx = endidx - len(text)
- matches = sorted(cmd2_app.path_complete(text, line, begidx, endidx))
+ matches = cmd2_app.path_complete(text, line, begidx, endidx)
expected = [text + 'cript.py', text + 'cript.txt', text + 'cripts' + os.path.sep]
assert matches == expected
@@ -408,9 +409,8 @@ def test_delimiter_completion(cmd2_app):
cmd2_app.delimiter_complete(text, line, begidx, endidx, delimited_strs, '/')
# Remove duplicates from display_matches and sort it. This is typically done in complete().
- display_set = set(cmd2_app.display_matches)
- display_list = list(display_set)
- display_list.sort()
+ display_list = utils.remove_duplicates(cmd2_app.display_matches)
+ display_list = utils.alphabetical_sort(display_list)
assert display_list == ['other user', 'user']