Mercurial > babel > old > mirror
diff babel/messages/tests/frontend.py @ 179:6138ea7ef7a8
* Instead of an extra `compile-all` option on the `compile` (or `compile_catalog`) command, compilation of all catalogs is performed when neither an `input_file` nor a `locale` is specified.
* The `--use-fuzzy` option works again from the command-line.
author | cmlenz |
---|---|
date | Wed, 27 Jun 2007 14:29:17 +0000 |
parents | 51fffa0a51ac |
children | e927dffc9ab4 |
line wrap: on
line diff
--- a/babel/messages/tests/frontend.py +++ b/babel/messages/tests/frontend.py @@ -48,10 +48,6 @@ def tearDown(self): os.chdir(self.olddir) - def test_no_locale_specified(self): - self.cmd.directory = 'dummy' - self.assertRaises(DistutilsOptionError, self.cmd.finalize_options) - def test_no_directory_or_output_file_specified(self): self.cmd.locale = 'en_US' self.cmd.input_file = 'dummy' @@ -467,7 +463,7 @@ -h, --help show this help message and exit commands: - compile compile a message catalog to a mo file + compile compile message catalogs to mo files extract extract messages from source files and generate a pot file init create new message catalogs from a template """, sys.stdout.getvalue().lower()) @@ -629,7 +625,7 @@ 'date': format_datetime(datetime.now(LOCALTZ), 'yyyy-MM-dd HH:mmZ', tzinfo=LOCALTZ, locale='en')}, open(po_file, 'U').read()) - + def test_compile_catalog(self): po_file = os.path.join(self.datadir, 'project', 'i18n', 'en_US', 'LC_MESSAGES', 'messages.po') @@ -656,7 +652,7 @@ """ % (po_file, pot_file), sys.stdout.getvalue()) shutil.rmtree(os.path.join(self.datadir, 'project', 'i18n', 'en_US')) - + def test_compile_fuzzy_catalog(self): self.setUp() po_file = os.path.join(self.datadir, 'project', 'i18n', 'en_US', @@ -677,10 +673,11 @@ assert os.path.isfile(mo_file) self.assertEqual("""\ creating catalog %r based on %r -compiling catalog to %r -""" % (po_file, pot_file, mo_file), sys.stdout.getvalue()) +compiling catalog %r to %r +""" % (po_file, pot_file, po_file, mo_file), sys.stdout.getvalue()) shutil.rmtree(os.path.join(self.datadir, 'project', 'i18n', 'en_US')) + def suite(): suite = unittest.TestSuite() suite.addTest(doctest.DocTestSuite(frontend))