From 82a123f1d43761d52a6fdebad000cedfd46f39d6 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Thu, 26 Apr 2018 01:13:54 +0900 Subject: [PATCH] Add testcase for thebibliography --- tests/test_build_latex.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index e8c2fa730..f70c58c4c 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -1247,3 +1247,20 @@ def test_latex_nested_enumerated_list(app, status, warning): assert r'\setcounter{enumii}{3}' in result assert r'\setcounter{enumiii}{9}' in result assert r'\setcounter{enumii}{2}' in result + + +@pytest.mark.sphinx('latex', testroot='footnotes') +def test_latex_thebibliography(app, status, warning): + app.builder.build_all() + + result = (app.outdir / 'Python.tex').text(encoding='utf8') + print(result) + assert ('\\begin{sphinxthebibliography}{AuthorYear}\n' + '\\bibitem[AuthorYear]{\\detokenize{AuthorYear}}' + '{\\phantomsection\\label{\\detokenize{index:authoryear}} \n' + 'Author, Title, Year\n' + '}\n' + '\\end{sphinxthebibliography}\n' in result) + assert ('{\\hyperref[\\detokenize{index:authoryear}]' + '{\\sphinxcrossref{{[}AuthorYear{]}}}}.}' + in result)