mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Update testcases for changing prefix of captions
This commit is contained in:
parent
1617e451af
commit
3d62e353a5
@ -166,8 +166,8 @@ def test_numref(app, status, warning):
|
|||||||
print(result)
|
print(result)
|
||||||
print(status.getvalue())
|
print(status.getvalue())
|
||||||
print(warning.getvalue())
|
print(warning.getvalue())
|
||||||
assert '\\renewcommand{\\figurename}{Fig. }' in result
|
assert '\\addto\\captionsenglish{\\renewcommand{\\figurename}{Fig. }}' in result
|
||||||
assert '\\renewcommand{\\tablename}{Table }' in result
|
assert '\\addto\\captionsenglish{\\renewcommand{\\tablename}{Table }}' in result
|
||||||
assert '\\floatname{literal-block}{Listing }' in result
|
assert '\\floatname{literal-block}{Listing }' in result
|
||||||
assert '\\hyperref[index:fig1]{Fig. \\ref{index:fig1}}' in result
|
assert '\\hyperref[index:fig1]{Fig. \\ref{index:fig1}}' in result
|
||||||
assert '\\hyperref[baz:fig22]{Figure\\ref{baz:fig22}}' in result
|
assert '\\hyperref[baz:fig22]{Figure\\ref{baz:fig22}}' in result
|
||||||
@ -188,8 +188,8 @@ def test_numref_with_prefix1(app, status, warning):
|
|||||||
print(result)
|
print(result)
|
||||||
print(status.getvalue())
|
print(status.getvalue())
|
||||||
print(warning.getvalue())
|
print(warning.getvalue())
|
||||||
assert '\\renewcommand{\\figurename}{Figure:}' in result
|
assert '\\addto\\captionsenglish{\\renewcommand{\\figurename}{Figure:}}' in result
|
||||||
assert '\\renewcommand{\\tablename}{Tab\\_}' in result
|
assert '\\addto\\captionsenglish{\\renewcommand{\\tablename}{Tab\\_}}' in result
|
||||||
assert '\\floatname{literal-block}{Code-}' in result
|
assert '\\floatname{literal-block}{Code-}' in result
|
||||||
assert '\\ref{index:fig1}' in result
|
assert '\\ref{index:fig1}' in result
|
||||||
assert '\\ref{baz:fig22}' in result
|
assert '\\ref{baz:fig22}' in result
|
||||||
@ -216,9 +216,9 @@ def test_numref_with_prefix2(app, status, warning):
|
|||||||
print(result)
|
print(result)
|
||||||
print(status.getvalue())
|
print(status.getvalue())
|
||||||
print(warning.getvalue())
|
print(warning.getvalue())
|
||||||
assert '\\renewcommand{\\figurename}{Figure:}' in result
|
assert '\\addto\\captionsenglish{\\renewcommand{\\figurename}{Figure:}}' in result
|
||||||
assert '\\def\\fnum@figure{\\figurename\\thefigure.}' in result
|
assert '\\def\\fnum@figure{\\figurename\\thefigure.}' in result
|
||||||
assert '\\renewcommand{\\tablename}{Tab\\_}' in result
|
assert '\\addto\\captionsenglish{\\renewcommand{\\tablename}{Tab\\_}}' in result
|
||||||
assert '\\def\\fnum@table{\\tablename\\thetable:}' in result
|
assert '\\def\\fnum@table{\\tablename\\thetable:}' in result
|
||||||
assert '\\floatname{literal-block}{Code-}' in result
|
assert '\\floatname{literal-block}{Code-}' in result
|
||||||
assert '\\hyperref[index:fig1]{Figure:\\ref{index:fig1}.}' in result
|
assert '\\hyperref[index:fig1]{Figure:\\ref{index:fig1}.}' in result
|
||||||
@ -229,6 +229,44 @@ def test_numref_with_prefix2(app, status, warning):
|
|||||||
assert '\\hyperref[baz:code22]{Code-\\ref{baz:code22}}' in result
|
assert '\\hyperref[baz:code22]{Code-\\ref{baz:code22}}' in result
|
||||||
|
|
||||||
|
|
||||||
|
@with_app(buildername='latex', testroot='numfig',
|
||||||
|
confoverrides={'numfig': True, 'language': 'el'})
|
||||||
|
def test_numref_with_language_el(app, status, warning):
|
||||||
|
app.builder.build_all()
|
||||||
|
result = (app.outdir / 'Python.tex').text(encoding='utf8')
|
||||||
|
print(result)
|
||||||
|
print(status.getvalue())
|
||||||
|
print(warning.getvalue())
|
||||||
|
assert '\\addto\\captionsgreek{\\renewcommand{\\figurename}{Fig. }}' in result
|
||||||
|
assert '\\addto\\captionsgreek{\\renewcommand{\\tablename}{Table }}' in result
|
||||||
|
assert '\\floatname{literal-block}{Listing }' in result
|
||||||
|
assert '\\hyperref[index:fig1]{Fig. \\ref{index:fig1}}' in result
|
||||||
|
assert '\\hyperref[baz:fig22]{Figure\\ref{baz:fig22}}' in result
|
||||||
|
assert '\\hyperref[index:table-1]{Table \\ref{index:table-1}}' in result
|
||||||
|
assert '\\hyperref[baz:table22]{Table:\\ref{baz:table22}}' in result
|
||||||
|
assert '\\hyperref[index:code-1]{Listing \\ref{index:code-1}}' in result
|
||||||
|
assert '\\hyperref[baz:code22]{Code-\\ref{baz:code22}}' in result
|
||||||
|
|
||||||
|
|
||||||
|
@with_app(buildername='latex', testroot='numfig',
|
||||||
|
confoverrides={'numfig': True, 'language': 'ja'})
|
||||||
|
def test_numref_with_language_ja(app, status, warning):
|
||||||
|
app.builder.build_all()
|
||||||
|
result = (app.outdir / 'Python.tex').text(encoding='utf8')
|
||||||
|
print(result)
|
||||||
|
print(status.getvalue())
|
||||||
|
print(warning.getvalue())
|
||||||
|
assert '\\renewcommand{\\figurename}{Fig. }\n' in result
|
||||||
|
assert '\\renewcommand{\\tablename}{Table }\n' in result
|
||||||
|
assert '\\floatname{literal-block}{Listing }' in result
|
||||||
|
assert '\\hyperref[index:fig1]{Fig. \\ref{index:fig1}}' in result
|
||||||
|
assert '\\hyperref[baz:fig22]{Figure\\ref{baz:fig22}}' in result
|
||||||
|
assert '\\hyperref[index:table-1]{Table \\ref{index:table-1}}' in result
|
||||||
|
assert '\\hyperref[baz:table22]{Table:\\ref{baz:table22}}' in result
|
||||||
|
assert '\\hyperref[index:code-1]{Listing \\ref{index:code-1}}' in result
|
||||||
|
assert '\\hyperref[baz:code22]{Code-\\ref{baz:code22}}' in result
|
||||||
|
|
||||||
|
|
||||||
@with_app(buildername='latex')
|
@with_app(buildername='latex')
|
||||||
def test_latex_add_latex_package(app, status, warning):
|
def test_latex_add_latex_package(app, status, warning):
|
||||||
app.add_latex_package('foo')
|
app.add_latex_package('foo')
|
||||||
|
Loading…
Reference in New Issue
Block a user