Mercurial > babel > mirror
comparison babel/messages/tests/pofile.py @ 191:c171a0041ad2 trunk
Add an option to the frontend commands for catalog updating that removes completely any obsolete messages, instead of putting them comments.
author | cmlenz |
---|---|
date | Sun, 01 Jul 2007 17:59:44 +0000 |
parents | 5041d90edf0c |
children | b38a6b220ea2 |
comparison
equal
deleted
inserted
replaced
190:5041d90edf0c | 191:c171a0041ad2 |
---|---|
192 #~ msgstr "" | 192 #~ msgstr "" |
193 #~ "Here's a message that covers\n" | 193 #~ "Here's a message that covers\n" |
194 #~ "multiple lines, and should still be handled\n" | 194 #~ "multiple lines, and should still be handled\n" |
195 #~ "correctly.\n"''', buf.getvalue().strip()) | 195 #~ "correctly.\n"''', buf.getvalue().strip()) |
196 | 196 |
197 def test_po_with_obsolete_message_ignored(self): | |
198 catalog = Catalog() | |
199 catalog.add(u'foo', u'Voh', locations=[('main.py', 1)]) | |
200 catalog.obsolete['bar'] = Message(u'bar', u'Bahr', | |
201 locations=[('utils.py', 3)], | |
202 user_comments=['User comment']) | |
203 buf = StringIO() | |
204 pofile.write_po(buf, catalog, omit_header=True, ignore_obsolete=True) | |
205 self.assertEqual('''#: main.py:1 | |
206 msgid "foo" | |
207 msgstr "Voh"''', buf.getvalue().strip()) | |
208 | |
197 | 209 |
198 def suite(): | 210 def suite(): |
199 suite = unittest.TestSuite() | 211 suite = unittest.TestSuite() |
200 suite.addTest(doctest.DocTestSuite(pofile)) | 212 suite.addTest(doctest.DocTestSuite(pofile)) |
201 suite.addTest(unittest.makeSuite(ReadPoTestCase)) | 213 suite.addTest(unittest.makeSuite(ReadPoTestCase)) |