diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-05-21 12:19:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-21 12:19:51 -0400 |
commit | c2594ff278ac50556cf4781910439ea1977a5873 (patch) | |
tree | ac10af5c53c45221062ff7440ea16a7343e7c230 /tests/test_bashcompletion.py | |
parent | a38e3f26887f60a358a5e36421a52526a04637f5 (diff) | |
parent | 34c7e650145c21499f3cc7667b71bb44c65fab01 (diff) | |
download | cmd2-git-c2594ff278ac50556cf4781910439ea1977a5873.tar.gz |
Merge pull request #409 from python-cmd2/autocompleter
Autocompleter
Diffstat (limited to 'tests/test_bashcompletion.py')
-rw-r--r-- | tests/test_bashcompletion.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_bashcompletion.py b/tests/test_bashcompletion.py index ceae2aa9..298bdf1e 100644 --- a/tests/test_bashcompletion.py +++ b/tests/test_bashcompletion.py @@ -139,15 +139,13 @@ def test_invalid_ifs(parser1, mock): @pytest.mark.parametrize('comp_line, exp_out, exp_err', [ ('media ', 'movies\013shows', ''), ('media mo', 'movies', ''), + ('media movies list -a "J', '"John Boyega"\013"Jake Lloyd"', ''), + ('media movies list ', '', ''), ('media movies add ', '\013\013 ', ''' Hint: TITLE Movie Title'''), - ('media movies list -a "J', '"John Boyega"\013"Jake Lloyd"', ''), - ('media movies list ', '', '') ]) def test_commands(parser1, capfd, mock, comp_line, exp_out, exp_err): - completer = CompletionFinder() - mock.patch.dict(os.environ, {'_ARGCOMPLETE': '1', '_ARGCOMPLETE_IFS': '\013', 'COMP_TYPE': '63', @@ -157,6 +155,8 @@ def test_commands(parser1, capfd, mock, comp_line, exp_out, exp_err): mock.patch.object(os, 'fdopen', my_fdopen) with pytest.raises(SystemExit): + completer = CompletionFinder() + choices = {'actor': query_actors, # function } autocompleter = AutoCompleter(parser1, arg_choices=choices) |