(self)
| 1560 | self.assertHelpEquals(expect) |
| 1561 | |
| 1562 | def test_help_description_groups(self): |
| 1563 | self.parser.set_description( |
| 1564 | "This is the program description for %prog. %prog has " |
| 1565 | "an option group as well as single options.") |
| 1566 | |
| 1567 | group = OptionGroup( |
| 1568 | self.parser, "Dangerous Options", |
| 1569 | "Caution: use of these options is at your own risk. " |
| 1570 | "It is believed that some of them bite.") |
| 1571 | group.add_option("-g", action="store_true", help="Group option.") |
| 1572 | self.parser.add_option_group(group) |
| 1573 | |
| 1574 | expect = """\ |
| 1575 | Usage: bar.py [options] |
| 1576 | |
| 1577 | This is the program description for bar.py. bar.py has an option group as |
| 1578 | well as single options. |
| 1579 | |
| 1580 | Options: |
| 1581 | -a APPLE throw APPLEs at basket |
| 1582 | -b NUM, --boo=NUM shout "boo!" NUM times (in order to frighten away all the |
| 1583 | evil spirits that cause trouble and mayhem) |
| 1584 | --foo=FOO store FOO in the foo list for later fooing |
| 1585 | -h, --help show this help message and exit |
| 1586 | |
| 1587 | Dangerous Options: |
| 1588 | Caution: use of these options is at your own risk. It is believed |
| 1589 | that some of them bite. |
| 1590 | |
| 1591 | -g Group option. |
| 1592 | """ |
| 1593 | |
| 1594 | self.assertHelpEquals(expect) |
| 1595 | |
| 1596 | self.parser.epilog = "Please report bugs to /dev/null." |
| 1597 | self.assertHelpEquals(expect + "\nPlease report bugs to /dev/null.\n") |
| 1598 | |
| 1599 | |
| 1600 | class TestMatchAbbrev(BaseTest): |
nothing calls this directly
no test coverage detected