diff 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
line wrap: on
line diff
--- a/babel/messages/tests/pofile.py
+++ b/babel/messages/tests/pofile.py
@@ -194,6 +194,18 @@
 #~ "multiple lines, and should still be handled\n"
 #~ "correctly.\n"''', buf.getvalue().strip())
 
+    def test_po_with_obsolete_message_ignored(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, ignore_obsolete=True)
+        self.assertEqual('''#: main.py:1
+msgid "foo"
+msgstr "Voh"''', buf.getvalue().strip())
+
 
 def suite():
     suite = unittest.TestSuite()
Copyright (C) 2012-2017 Edgewall Software