diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-04-17 01:25:58 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-04-17 01:25:58 -0400 |
commit | 94da51a0dd04c76cd01680926e5c020eb9932b51 (patch) | |
tree | 8780d37c996dd72b8a61a324c1d4964065af73c4 | |
parent | 9e24c983806c3cb6ff0722f5f2314ff56de2933c (diff) | |
parent | dadcd2712c3f5830128a8c70e2a449f9f2b59b05 (diff) | |
download | cmd2-git-94da51a0dd04c76cd01680926e5c020eb9932b51.tar.gz |
Merge branch 'autocompleter' of github.com:python-cmd2/cmd2 into autocompleter
-rw-r--r-- | tests/test_autocompletion.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/test_autocompletion.py b/tests/test_autocompletion.py index f65f7398..aa82adad 100644 --- a/tests/test_autocompletion.py +++ b/tests/test_autocompletion.py @@ -1,4 +1,3 @@ -# coding=utf-8 """ Unit/functional testing for readline tab-completion functions in the cmd2.py module. @@ -68,14 +67,14 @@ def complete_tester(text, line, begidx, endidx, app): def get_endidx(): return endidx - first_match = None + first_match = [] with mock.patch.object(readline, 'get_line_buffer', get_line): with mock.patch.object(readline, 'get_begidx', get_begidx): with mock.patch.object(readline, 'get_endidx', get_endidx): # Run the readline tab-completion function with readline mocks in place first_match = app.complete(text, 0) - return first_match + return first_match if not None else [] SUGGEST_HELP = '''Usage: suggest -t {movie, show} [-h] [-d DURATION{1..2}] @@ -146,6 +145,8 @@ def test_autocomp_flags(cmd2_app): assert first_match is not None and \ cmd2_app.completion_matches == ['--duration', '--help', '--type', '-d', '-h', '-t'] +@pytest.mark.skipif(sys.platform == 'win32', + reason="Unit test doesn't work on win32, but feature does") def test_autcomp_hint(cmd2_app, capsys): text = '' line = 'suggest -d {}'.format(text) @@ -187,6 +188,8 @@ def test_autocomp_flags_choices(cmd2_app): cmd2_app.completion_matches == ['movie', 'show'] +@pytest.mark.skipif(sys.platform == 'win32', + reason="Unit test doesn't work on win32, but feature does") def test_autcomp_hint_in_narg_range(cmd2_app, capsys): text = '' line = 'suggest -d 2 {}'.format(text) |