Esempio n. 1
0
def test_rstmanpage_formatter():
    parsers = setup_parser(return_subparsers=True)
    for p in parsers:
        mp = fmt.RSTManPageFormatter(p).format_man_page(parsers[p])
        for section in ('Synopsis', 'Description', 'Options'):
            assert_in('\n{0}'.format(section), mp)
        assert_in('{0}\n{1}'.format(p, '=' * len(p)), mp)
Esempio n. 2
0
def test_manpage_formatter():
    addonsections = {'mytest': "uniquedummystring"}

    parsers = setup_parser(return_subparsers=True)
    for p in parsers:
        mp = fmt.ManPageFormatter(
            p, ext_sections=addonsections).format_man_page(parsers[p])
        for section in ('SYNOPSIS', 'DESCRIPTION', 'OPTIONS', 'MYTEST'):
            assert_in('.SH {0}'.format(section), mp)
        assert_in('uniquedummystring', mp)
Esempio n. 3
0
def test_parser_access():
    parsers = setup_parser(return_subparsers=True)
    # we have a bunch
    ok_(len(parsers) > 3)
    assert_in('create', parsers.keys())