summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsteven.bethard <devnull@localhost>2009-07-13 00:34:43 +0000
committersteven.bethard <devnull@localhost>2009-07-13 00:34:43 +0000
commit849841ad0021e632141f9c7353bd98264b193fe2 (patch)
tree44c108ca1d3acf39811906c48819e9eb26c77364 /test
parentbe051b2738ef9e459651e3c75a24f0ce97374d0c (diff)
downloadargparse-849841ad0021e632141f9c7353bd98264b193fe2.tar.gz
Allow tuples for metavars.
Diffstat (limited to 'test')
-rw-r--r--test/test_argparse.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/test_argparse.py b/test/test_argparse.py
index 67026d9..bd5a854 100644
--- a/test/test_argparse.py
+++ b/test/test_argparse.py
@@ -3080,6 +3080,33 @@ class TestHelpNone(HelpTestCase):
version = ''
+class TestHelpTupleMetavar(HelpTestCase):
+ """Test specifying metavar as a tuple"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-w', help='w', nargs='+', metavar=('W1', 'W2')),
+ Sig('-x', help='x', nargs='*', metavar=('X1', 'X2')),
+ Sig('-y', help='y', nargs=3, metavar=('Y1', 'Y2', 'Y3')),
+ Sig('-z', help='z', nargs='?', metavar=('Z1', )),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] \
+[-z [Z1]]
+ '''
+ help = usage + '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w W1 [W2 ...] w
+ -x [X1 [X2 ...]] x
+ -y Y1 Y2 Y3 y
+ -z [Z1] z
+ '''
+ version = ''
+
+
class TestHelpRawText(HelpTestCase):
"""Test the RawTextHelpFormatter"""