Add a testcase for deterministic msgid order

This commit is contained in:
cocoatomo
2018-02-18 09:05:32 +09:00
parent 582c829fa8
commit 07d2cdd47b
5 changed files with 28 additions and 0 deletions

View File

@@ -165,3 +165,18 @@ def test_gettext_template(app):
result = (app.outdir / 'sphinx.pot').text(encoding='utf-8')
assert "Welcome" in result
assert "Sphinx %(version)s" in result
@pytest.mark.sphinx('gettext', testroot='intl-template')
def test_gettext_template_msgid_order_in_sphinxpot(app):
app.builder.build_all()
assert (app.outdir / 'sphinx.pot').isfile()
result = (app.outdir / 'sphinx.pot').text(encoding='utf-8')
assert re.search(
('msgid "Template 1".*'
'msgid "This is Template 1\.".*'
'msgid "Template 2".*'
'msgid "This is Template 2\.".*'),
result,
flags=re.S)