Mercurial > babel > mirror
diff babel/messages/tests/pofile.py @ 181:8a762ce37bf7 trunk
The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
author | cmlenz |
---|---|
date | Thu, 28 Jun 2007 10:28:25 +0000 |
parents | 5d32098d8352 |
children | 5041d90edf0c |
line wrap: on
line diff
--- a/babel/messages/tests/pofile.py +++ b/babel/messages/tests/pofile.py @@ -16,7 +16,7 @@ from StringIO import StringIO import unittest -from babel.messages.catalog import Catalog +from babel.messages.catalog import Catalog, Message from babel.messages import pofile @@ -150,6 +150,22 @@ msgid "bar" msgstr ""''', buf.getvalue().strip()) + def test_po_with_obsolete_messages(self): + catalog = Catalog() + catalog.add(u'foo', u'Voh', locations=[('main.py', 1)]) + catalog.obsolete['bar'] = Message(u'bar', u'Bahr', + locations=[('utils.py', 3)], + user_comments=['User comment']) + buf = StringIO() + pofile.write_po(buf, catalog, omit_header=True) + self.assertEqual('''#: main.py:1 +msgid "foo" +msgstr "Voh" + +# User comment +#~ msgid "bar" +#~ msgstr "Bahr"''', buf.getvalue().strip()) + def suite(): suite = unittest.TestSuite()