From e239e5168557e011e36c122fbb678080123390e0 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 21 Aug 2010 20:30:11 +0200 Subject: [PATCH] Give an explicit locale so that the output file name of msginit is deterministic. --- tests/test_build_gettext.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/test_build_gettext.py b/tests/test_build_gettext.py index 032911111..ba2440fd4 100644 --- a/tests/test_build_gettext.py +++ b/tests/test_build_gettext.py @@ -37,7 +37,8 @@ def test_gettext(app): os.chdir(app.outdir) try: try: - p = Popen(['msginit', '--no-translator', '-i', 'markup.pot'], + p = Popen(['msginit', '--no-translator', '-i', 'markup.pot', + '--locale', 'en_US'], stdout=PIPE, stderr=PIPE) except OSError: return # most likely msginit was not found @@ -74,15 +75,6 @@ def test_gettext(app): def test_all(app): app.builder.build_all() -@with_app(buildername='text', - confoverrides={'language': 'xx', 'locale_dirs': ['.']}) -def test_patch(app): - app.builder.build(['bom']) - result = (app.outdir / 'bom.txt').text(encoding='utf-8') - expect = (u"\nDatei mit UTF-8" - u"\n***************\n" # underline matches new translation - u"\nThis file has umlauts: äöü.\n") - assert result == expect def setup_patch(): (test_root / 'xx' / 'LC_MESSAGES').makedirs() @@ -103,5 +95,16 @@ def setup_patch(): def teardown_patch(): (test_root / 'xx').rmtree() + +@with_app(buildername='text', + confoverrides={'language': 'xx', 'locale_dirs': ['.']}) +def test_patch(app): + app.builder.build(['bom']) + result = (app.outdir / 'bom.txt').text(encoding='utf-8') + expect = (u"\nDatei mit UTF-8" + u"\n***************\n" # underline matches new translation + u"\nThis file has umlauts: äöü.\n") + assert result == expect + test_patch.setup = setup_patch test_patch.teardown = teardown_patch