diff options
| author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-10-10 18:08:11 -0400 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-10-10 18:08:11 -0400 |
| commit | 9b43502ab70d1bd013a4cdede4805c2c0819c8c4 (patch) | |
| tree | c8c12774764fa0b9f226b1f02c3614236bb03a23 /tests/test_completion.py | |
| parent | f38e100fd77f4a136a4883d23b2f4f8b3cd934b7 (diff) | |
| download | cmd2-git-9b43502ab70d1bd013a4cdede4805c2c0819c8c4.tar.gz | |
Added code to handle -- in argparse completer
Diffstat (limited to 'tests/test_completion.py')
| -rw-r--r-- | tests/test_completion.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/tests/test_completion.py b/tests/test_completion.py index ed36eb01..0df06423 100644 --- a/tests/test_completion.py +++ b/tests/test_completion.py @@ -716,31 +716,6 @@ def test_add_opening_quote_delimited_space_in_prefix(cmd2_app): os.path.commonprefix(cmd2_app.completion_matches) == expected_common_prefix and \ cmd2_app.display_matches == expected_display -def test_argparse_remainder_completion(cmd2_app): - # First test a positional with nargs=argparse.REMAINDER - text = '--h' - line = 'help command subcommand {}'.format(text) - endidx = len(line) - begidx = endidx - len(text) - - # --h should not complete into --help because we are in the argparse.REMAINDER sections - assert complete_tester(text, line, begidx, endidx, cmd2_app) is None - - # Now test a flag with nargs=argparse.REMAINDER - parser = argparse.ArgumentParser() - parser.add_argument('-f', nargs=argparse.REMAINDER) - - # Overwrite eof's parser for this test - cmd2.Cmd.do_eof.argparser = parser - - text = '--h' - line = 'eof -f {}'.format(text) - endidx = len(line) - begidx = endidx - len(text) - - # --h should not complete into --help because we are in the argparse.REMAINDER sections - assert complete_tester(text, line, begidx, endidx, cmd2_app) is None - @pytest.fixture def sc_app(): c = SubcommandsExample() |
