sphinx/tests/test_build_manpage.py

43 lines
1.3 KiB
Python
Raw Normal View History

2016-01-08 01:00:26 -06:00
# -*- coding: utf-8 -*-
"""
test_build_manpage
~~~~~~~~~~~~~~~~~~
Test the build process with manpage builder with the test root.
2017-12-31 10:06:58 -06:00
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
2016-01-08 01:00:26 -06:00
:license: BSD, see LICENSE for details.
"""
import pytest
2016-01-08 01:00:26 -06:00
from sphinx.builders.manpage import default_man_pages
from sphinx.config import Config
2016-01-08 01:00:26 -06:00
@pytest.mark.sphinx('man')
2016-01-08 01:00:26 -06:00
def test_all(app, status, warning):
app.builder.build_all()
assert (app.outdir / 'sphinxtests.1').exists()
2016-01-08 01:00:26 -06:00
content = (app.outdir / 'sphinxtests.1').text()
2016-01-08 01:00:26 -06:00
assert r'\fBprint \fP\fIi\fP\fB\en\fP' in content
assert r'\fBmanpage\en\fP' in content
# term of definition list including nodes.strong
assert '\n.B term1\n' in content
assert '\nterm2 (\\fBstronged partially\\fP)\n' in content
2018-12-08 09:35:46 -06:00
assert 'Footnotes' not in content
def test_default_man_pages():
config = Config({'master_doc': 'index',
'project': u'STASI™ Documentation',
'author': u"Wolfgang Schäuble & G'Beckstein",
'release': '1.0'})
config.init_values()
expected = [('index', 'stasi', u'STASI™ Documentation 1.0',
[u"Wolfgang Schäuble & G'Beckstein"], 1)]
assert default_man_pages(config) == expected