URL: https://github.com/freeipa/freeipa/pull/110
Author: mbasti-rh
 Title: #110: test_text: add test ipa.pot file for tests
Action: opened

PR body:
"""
Input data should be packaged into freeipa-test module to be able run
test from RPM (outoftree)

https://fedorahosted.org/freeipa/ticket/6333
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/110/head:pr110
git checkout pr110
From 22bf6e7ac35172916ac2a4c53e08a13b3cc89d9c Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Fri, 23 Sep 2016 09:51:41 +0200
Subject: [PATCH] test_text: add test ipa.pot file for tests

Input data should be packaged into freeipa-test module to be able run
test from RPM (outoftree)

https://fedorahosted.org/freeipa/ticket/6333
---
 ipatests/setup.py.in              |  1 +
 ipatests/test_ipalib/data/ipa.pot | 47 +++++++++++++++++++++++++++++++++++++++
 ipatests/test_ipalib/test_text.py | 11 ++++-----
 3 files changed, 54 insertions(+), 5 deletions(-)
 create mode 100644 ipatests/test_ipalib/data/ipa.pot

diff --git a/ipatests/setup.py.in b/ipatests/setup.py.in
index cb5f722..18483b0 100644
--- a/ipatests/setup.py.in
+++ b/ipatests/setup.py.in
@@ -82,6 +82,7 @@ def setup_package():
                 'ipatests': ['pytest.ini'],
                 'ipatests.test_install': ['*.update'],
                 'ipatests.test_integration': ['scripts/*'],
+                'ipatests.test_ipalib': ['data/*'],
                 'ipatests.test_pkcs10': ['*.csr'],
                 "ipatests.test_ipaserver": ['data/*'],
                 'ipatests.test_xmlrpc': ['data/*'],
diff --git a/ipatests/test_ipalib/data/ipa.pot b/ipatests/test_ipalib/data/ipa.pot
new file mode 100644
index 0000000..523d3e2
--- /dev/null
+++ b/ipatests/test_ipalib/data/ipa.pot
@@ -0,0 +1,47 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Red Hat
+# This file is distributed under the same license as the ipa package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: ipa\n"
+"Report-Msgid-Bugs-To: https://fedorahosted.org/freeipa/newticket\n";
+"POT-Creation-Date: 2016-08-29 10:39+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <l...@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+
+#: ipaclient/frontend.py:28 ipaclient/frontend.py:85
+#: ipaserver/plugins/baseldap.py:52
+msgid "Failed members"
+msgstr ""
+
+#: ipaclient/frontend.py:32 ipaserver/plugins/baseldap.py:169
+msgid "Failed source hosts/hostgroups"
+msgstr ""
+
+#: ipaclient/frontend.py:36 ipaserver/plugins/baseldap.py:172
+msgid "Failed hosts/hostgroups"
+msgstr ""
+
+#: ipaclient/frontend.py:40 ipaserver/plugins/baseldap.py:175
+msgid "Failed users/groups"
+msgstr ""
+
+#: ipaclient/plugins/dns.py:249
+#, python-format
+msgid ""
+"%(count)d %(type)s record skipped. Only one value per DNS record type can be "
+"modified at one time."
+msgid_plural ""
+"%(count)d %(type)s records skipped. Only one value per DNS record type can "
+"be modified at one time."
+msgstr[0] ""
+msgstr[1] ""
diff --git a/ipatests/test_ipalib/test_text.py b/ipatests/test_ipalib/test_text.py
index bdc7623..d510646 100644
--- a/ipatests/test_ipalib/test_text.py
+++ b/ipatests/test_ipalib/test_text.py
@@ -59,8 +59,6 @@ def setup(self):
         self.lang = 'xh_ZA'
         self.domain = 'ipa'
 
-        self.ipa_i18n_dir = os.path.join(os.path.dirname(__file__), '../../install/po')
-
         self.pot_basename = '%s.pot' % self.domain
         self.po_basename = '%s.po' % self.lang
         self.mo_basename = '%s.mo' % self.domain
@@ -74,7 +72,8 @@ def setup(self):
         if not os.path.exists(self.msg_dir):
             os.makedirs(self.msg_dir)
 
-        self.pot_file = os.path.join(self.ipa_i18n_dir, self.pot_basename)
+        self.pot_file = os.path.join(
+            os.path.dirname(__file__), 'data', self.pot_basename)
         self.mo_file = os.path.join(self.msg_dir, self.mo_basename)
         self.po_file = os.path.join(self.tmp_dir, self.po_basename)
 
@@ -84,10 +83,12 @@ def setup(self):
                                 (self.po_file, self.mo_file, self.pot_file))
 
         if not file_exists(self.po_file):
-            raise nose.SkipTest('Test po file unavailable, run "make test" in install/po')
+            raise nose.SkipTest(
+                'Test po file unavailable: {}'.format(self.po_file))
 
         if not file_exists(self.mo_file):
-            raise nose.SkipTest('Test mo file unavailable, run "make test" in install/po')
+            raise nose.SkipTest(
+                'Test mo file unavailable: {}'.format(self.mo_file))
 
         self.po_file_iterate = po_file_iterate
 
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to