diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-08-12 23:28:33 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-08-12 23:28:33 -0400 |
commit | 594bb56e880281097faafc0ee860a59303a50607 (patch) | |
tree | 19e8d4488d5424c4acf1c1ad4fe6c4012dd3c218 /tests | |
parent | d12a601edb21ae1e9e637d820d1e53c4d3e90c45 (diff) | |
download | cmd2-git-594bb56e880281097faafc0ee860a59303a50607.tar.gz |
Add unit test and update CHANGELOG
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_argparse_custom.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_argparse_custom.py b/tests/test_argparse_custom.py index f4db12b6..3ce90118 100644 --- a/tests/test_argparse_custom.py +++ b/tests/test_argparse_custom.py @@ -260,3 +260,10 @@ def test_override_parser(): # Verify DEFAULT_ARGUMENT_PARSER is now our CustomParser from examples.custom_parser import CustomParser assert DEFAULT_ARGUMENT_PARSER == CustomParser + + +def test_apcustom_metavar_tuple(): + # Test the case when a tuple metavar is used with nargs an integer > 1 + parser = Cmd2ArgumentParser() + parser.add_argument('--aflag', nargs=2, metavar=('foo', 'bar'), help='This is a test') + assert '[--aflag foo bar]' in parser.format_help() |