summaryrefslogtreecommitdiff
path: root/tests/test_build_latex.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-12-21 17:39:25 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2020-03-06 22:11:08 +0900
commit4ab4100cc57a1fb742f8849a75be3be758437fe8 (patch)
treed8841287612314f54223ad441a0ea8ecdd81cc42 /tests/test_build_latex.py
parent39a191294e615af6465e347b8e31ae2f76d51653 (diff)
downloadsphinx-git-4ab4100cc57a1fb742f8849a75be3be758437fe8.tar.gz
test: Add testcases for latex docclasses
Diffstat (limited to 'tests/test_build_latex.py')
-rw-r--r--tests/test_build_latex.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py
index bd4089fe7..88c79b5ed 100644
--- a/tests/test_build_latex.py
+++ b/tests/test_build_latex.py
@@ -165,6 +165,56 @@ def test_latex_basic(app, status, warning):
assert r'\renewcommand{\releasename}{}' in result
+@pytest.mark.sphinx('latex', testroot='basic',
+ confoverrides={
+ 'latex_documents': [('index', 'test.tex', 'title', 'author', 'manual')]
+ })
+def test_latex_basic_manual(app, status, warning):
+ app.builder.build_all()
+ result = (app.outdir / 'test.tex').read_text(encoding='utf8')
+ print(result)
+ assert r'\def\sphinxdocclass{report}' in result
+ assert r'\documentclass[letterpaper,10pt,english]{sphinxmanual}' in result
+
+
+@pytest.mark.sphinx('latex', testroot='basic',
+ confoverrides={
+ 'latex_documents': [('index', 'test.tex', 'title', 'author', 'howto')]
+ })
+def test_latex_basic_howto(app, status, warning):
+ app.builder.build_all()
+ result = (app.outdir / 'test.tex').read_text(encoding='utf8')
+ print(result)
+ assert r'\def\sphinxdocclass{article}' in result
+ assert r'\documentclass[letterpaper,10pt,english]{sphinxhowto}' in result
+
+
+@pytest.mark.sphinx('latex', testroot='basic',
+ confoverrides={
+ 'language': 'ja',
+ 'latex_documents': [('index', 'test.tex', 'title', 'author', 'manual')]
+ })
+def test_latex_basic_manual_ja(app, status, warning):
+ app.builder.build_all()
+ result = (app.outdir / 'test.tex').read_text(encoding='utf8')
+ print(result)
+ assert r'\def\sphinxdocclass{jsbook}' in result
+ assert r'\documentclass[letterpaper,10pt,dvipdfmx]{sphinxmanual}' in result
+
+
+@pytest.mark.sphinx('latex', testroot='basic',
+ confoverrides={
+ 'language': 'ja',
+ 'latex_documents': [('index', 'test.tex', 'title', 'author', 'howto')]
+ })
+def test_latex_basic_howto_ja(app, status, warning):
+ app.builder.build_all()
+ result = (app.outdir / 'test.tex').read_text(encoding='utf8')
+ print(result)
+ assert r'\def\sphinxdocclass{jreport}' in result
+ assert r'\documentclass[letterpaper,10pt,dvipdfmx]{sphinxhowto}' in result
+
+
@pytest.mark.sphinx('latex', testroot='basic', confoverrides={'language': 'zh'})
def test_latex_additional_settings_for_language_code(app, status, warning):
app.builder.build_all()