mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add test for latex obey numfig_secnum_depth feature
This commit is contained in:
parent
7ea4fa535a
commit
43bed034cd
10
tests/roots/test-latex-numfig/conf.py
Normal file
10
tests/roots/test-latex-numfig/conf.py
Normal file
@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
master_doc = 'index'
|
||||
|
||||
latex_documents = [
|
||||
('indexmanual', 'SphinxManual.tex', 'Test numfig manual',
|
||||
'Sphinx', 'manual'),
|
||||
('indexhowto', 'SphinxHowTo.tex', 'Test numfig howto',
|
||||
'Sphinx', 'howto'),
|
||||
]
|
9
tests/roots/test-latex-numfig/index.rst
Normal file
9
tests/roots/test-latex-numfig/index.rst
Normal file
@ -0,0 +1,9 @@
|
||||
=================
|
||||
test-latex-numfig
|
||||
=================
|
||||
|
||||
.. toctree::
|
||||
:numbered:
|
||||
|
||||
indexmanual
|
||||
indexhowto
|
10
tests/roots/test-latex-numfig/indexhowto.rst
Normal file
10
tests/roots/test-latex-numfig/indexhowto.rst
Normal file
@ -0,0 +1,10 @@
|
||||
=======================
|
||||
test-latex-numfig-howto
|
||||
=======================
|
||||
|
||||
This is a part
|
||||
==============
|
||||
|
||||
This is a section
|
||||
-----------------
|
||||
|
13
tests/roots/test-latex-numfig/indexmanual.rst
Normal file
13
tests/roots/test-latex-numfig/indexmanual.rst
Normal file
@ -0,0 +1,13 @@
|
||||
========================
|
||||
test-latex-numfig-manual
|
||||
========================
|
||||
|
||||
First part
|
||||
==========
|
||||
|
||||
This is chapter
|
||||
---------------
|
||||
|
||||
This is section
|
||||
~~~~~~~~~~~~~~~
|
||||
|
@ -335,6 +335,43 @@ def test_numref_with_language_ja(app, status, warning):
|
||||
'\\nameref{\\detokenize{foo:foo}}}') in result
|
||||
|
||||
|
||||
@pytest.mark.sphinx('latex', testroot='latex-numfig')
|
||||
def test_latex_obey_numfig_is_false(app, status, warning):
|
||||
app.builder.build_all()
|
||||
|
||||
result = (app.outdir / 'SphinxManual.tex').text(encoding='utf8')
|
||||
assert '\\usepackage{sphinx}' in result
|
||||
|
||||
result = (app.outdir / 'SphinxHowTo.tex').text(encoding='utf8')
|
||||
assert '\\usepackage{sphinx}' in result
|
||||
|
||||
|
||||
@pytest.mark.sphinx(
|
||||
'latex', testroot='latex-numfig',
|
||||
confoverrides={'numfig': True, 'numfig_secnum_depth': 0})
|
||||
def test_latex_obey_numfig_secnum_depth_is_zero(app, status, warning):
|
||||
app.builder.build_all()
|
||||
|
||||
result = (app.outdir / 'SphinxManual.tex').text(encoding='utf8')
|
||||
assert '\\usepackage[,nonumfigreset]{sphinx}' in result
|
||||
|
||||
result = (app.outdir / 'SphinxHowTo.tex').text(encoding='utf8')
|
||||
assert '\\usepackage[,nonumfigreset]{sphinx}' in result
|
||||
|
||||
|
||||
@pytest.mark.sphinx(
|
||||
'latex', testroot='latex-numfig',
|
||||
confoverrides={'numfig': True, 'numfig_secnum_depth': 2})
|
||||
def test_latex_obey_numfig_secnum_depth_is_two(app, status, warning):
|
||||
app.builder.build_all()
|
||||
|
||||
result = (app.outdir / 'SphinxManual.tex').text(encoding='utf8')
|
||||
assert '\\usepackage[,numfigreset=2]{sphinx}' in result
|
||||
|
||||
result = (app.outdir / 'SphinxHowTo.tex').text(encoding='utf8')
|
||||
assert '\\usepackage[,numfigreset=3]{sphinx}' in result
|
||||
|
||||
|
||||
@pytest.mark.sphinx('latex')
|
||||
def test_latex_add_latex_package(app, status, warning):
|
||||
app.add_latex_package('foo')
|
||||
|
Loading…
Reference in New Issue
Block a user