mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-13 17:02:12 -05:00
Merge with default
This commit is contained in:
commit
7e59c5385e
8 files changed
+76
-25
No files matched your search
@@ -6,3 +6,4 @@ keep_warnings = True
|
||||
templates_path = ['_templates']
|
||||
html_additional_pages = {'index': 'index.html'}
|
||||
release = version = '2013.120'
|
||||
gettext_enables = ['index']
|
||||
@@ -113,6 +113,38 @@ def test_gettext_index_entries(app, status, warning):
|
||||
"Exception",
|
||||
"Statement",
|
||||
"Builtin",
|
||||
]
|
||||
for expect in expected_msgids:
|
||||
assert expect in msgids
|
||||
msgids.remove(expect)
|
||||
|
||||
# unexpected msgid existent
|
||||
assert msgids == []
|
||||
|
||||
|
||||
@with_app('gettext', testroot='intl',
|
||||
confoverrides={'gettext_compact': False, 'gettext_enables': []})
|
||||
def test_gettext_disable_index_entries(app, status, warning):
|
||||
# regression test for #976
|
||||
app.builder.build(['index_entries'])
|
||||
|
||||
_msgid_getter = re.compile(r'msgid "(.*)"').search
|
||||
|
||||
def msgid_getter(msgid):
|
||||
m = _msgid_getter(msgid)
|
||||
if m:
|
||||
return m.groups()[0]
|
||||
return None
|
||||
|
||||
pot = (app.outdir / 'index_entries.pot').text(encoding='utf-8')
|
||||
msgids = [_f for _f in map(msgid_getter, pot.splitlines()) if _f]
|
||||
|
||||
expected_msgids = [
|
||||
"i18n with index entries",
|
||||
"index target section",
|
||||
"this is :index:`Newsletter` target paragraph.",
|
||||
"various index entries",
|
||||
"That's all.",
|
||||
]
|
||||
for expect in expected_msgids:
|
||||
assert expect in msgids
|
||||
|
||||
@@ -98,5 +98,6 @@ def test_latex_add_latex_package(app, status, warning):
|
||||
app.add_latex_package('foo')
|
||||
app.add_latex_package('bar', 'baz')
|
||||
app.builder.build_all()
|
||||
assert '\\usepackage{foo}' in (app.outdir / 'SphinxTests.tex').text()
|
||||
assert '\\usepackage[baz]{bar}' in (app.outdir / 'SphinxTests.tex').text()
|
||||
result = (app.outdir / 'SphinxTests.tex').text(encoding='utf8')
|
||||
assert '\\usepackage{foo}' in result
|
||||
assert '\\usepackage[baz]{bar}' in result
|
||||
Reference in new issue
Block a user