Skip to content

Commit 675dbf5

Browse files
author
Ulrik Haugen
committed
Add test_fill_in_description
1 parent d7a8384 commit 675dbf5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/test_parser.py

+14
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,20 @@ def test_fill_in_default_prog():
344344
]
345345

346346

347+
def test_fill_in_description_epilog():
348+
"""
349+
Ensure that %(prog)s gets filled in inside description and epilog.
350+
"""
351+
parser = argparse.ArgumentParser(
352+
prog='test_fill_in_description',
353+
description='Welcome to %(prog)s',
354+
epilog='%(prog)s salutes you')
355+
data = parse_parser(parser)
356+
357+
assert data['description'] == 'Welcome to test_fill_in_description'
358+
assert data['epilog'] == 'test_fill_in_description salutes you'
359+
360+
347361
def test_string_quoting():
348362
"""
349363
If an optional argument has a string type and a default, then the default should be in quotes.

0 commit comments

Comments
 (0)