diff --git a/tests/test_build_gettext.py b/tests/test_build_gettext.py index caa775875..3a992e12f 100644 --- a/tests/test_build_gettext.py +++ b/tests/test_build_gettext.py @@ -9,6 +9,9 @@ :license: BSD, see LICENSE for details. """ +import os +from subprocess import Popen, PIPE + from util import * @@ -22,3 +25,22 @@ def test_gettext(app): assert (app.outdir / 'contents.pot').isfile() # group into sections assert (app.outdir / 'subdir.pot').isfile() + + cwd = os.getcwd() + os.chdir(app.outdir) + try: + try: + p = Popen(['msginit', '--no-translator', '-i', 'contents.pot'], + stdout=PIPE, stderr=PIPE) + except OSError: + return # most likely msginit was not found + else: + stdout, stderr = p.communicate() + if p.returncode != 0: + print stdout + print stderr + del app.cleanup_trees[:] + assert False, 'msginit exited with return code %s' % p.returncode + assert (app.outdir / 'en_US.po').isfile(), 'msginit failed' + finally: + os.chdir(cwd)