diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-06 22:11:13 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2013-04-09 09:36:51 (GMT) |
commit | 617c11a078cf4225dd591dffc67e6b495291aae0 (patch) | |
tree | ee588054630e659abaeb25de662da9f0bc0c5490 | |
parent | ac153f3cdc94369cf5900093e52d7b232f550183 (diff) |
Add test for the genpot command
-rw-r--r-- | tests/test_bundlebuilder.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_bundlebuilder.py b/tests/test_bundlebuilder.py index fc99fda..d829281 100644 --- a/tests/test_bundlebuilder.py +++ b/tests/test_bundlebuilder.py @@ -123,6 +123,20 @@ class TestGit(unittest.TestCase): self.assertItemsEqual(filenames, self._get_all_locale_files()) os.chdir(cwd) + + def _test_genpot(self, source_path, build_path): + cwd = os.getcwd() + os.chdir(build_path) + + pot_path = os.path.join(source_path, "po", "Sample.pot") + os.unlink(pot_path) + + setup_path = os.path.join(source_path, "setup.py") + subprocess.call([setup_path, "genpot"]) + + self.assertTrue(os.path.exists(pot_path)) + + os.chdir(cwd) def _test_install(self, source_path, build_path): install_path = tempfile.mkdtemp() @@ -193,3 +207,12 @@ class TestGit(unittest.TestCase): repo_path = self._create_repo() build_path = tempfile.mkdtemp() self._test_build(repo_path, build_path) + + def test_genpot_in_source(self): + repo_path = self._create_repo() + self._test_genpot(repo_path, repo_path) + + def test_genpot_out_of_source(self): + repo_path = self._create_repo() + build_path = tempfile.mkdtemp() + self._test_genpot(repo_path, build_path) |