mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
test: check latex document beginning
* Check some commands in latex basic test: * \begin{document} * \maketitle * \sphinxtableofcontents * Add a test on shorthandoff insertion Signed-off-by: Alizée Penel <alizee@lse.epita.fr>
This commit is contained in:
parent
a3bfccc11f
commit
a8f23b1d44
@ -178,11 +178,27 @@ def test_latex_basic(app, status, warning):
|
||||
print(result)
|
||||
print(status.getvalue())
|
||||
print(warning.getvalue())
|
||||
assert r'\begin{document}' in result
|
||||
assert r'\maketitle' in result
|
||||
assert r'\sphinxtableofcontents' in result
|
||||
assert r'\title{The basic Sphinx documentation for testing}' in result
|
||||
assert r'\release{}' in result
|
||||
assert r'\renewcommand{\releasename}{}' in result
|
||||
|
||||
|
||||
@pytest.mark.sphinx('latex', testroot='basic', confoverrides={'language':'de'})
|
||||
def test_latex_shorthandoff(app, status, warning):
|
||||
app.builder.build_all()
|
||||
result = (app.outdir / 'test.tex').text(encoding='utf8')
|
||||
print(result)
|
||||
print(status.getvalue())
|
||||
print(warning.getvalue())
|
||||
assert ('\\ifdefined\\shorthandoff\n'
|
||||
' \\ifnum\\catcode`\\=\\string=\\active\\shorthandoff{=}\\fi\n'
|
||||
' \\ifnum\\catcode`\\"=\\active\\shorthandoff{"}\\fi\n'
|
||||
'\\fi\n' in result)
|
||||
|
||||
|
||||
@pytest.mark.sphinx('latex', testroot='latex-title')
|
||||
def test_latex_title_after_admonitions(app, status, warning):
|
||||
app.builder.build_all()
|
||||
|
Loading…
Reference in New Issue
Block a user