comparison babel/messages/tests/pofile.py @ 228:6582494abc36 trunk

Follow-up to [239]: also combine duplicate comments when writing PO files.
author cmlenz
date Fri, 20 Jul 2007 16:47:08 +0000
parents fc1f8cd448fc
children 51a1f6101fa6
comparison
equal deleted inserted replaced
227:b6927ec68261 228:6582494abc36
115 catalog.add(u'foo', locations=[('main.py', 1)]) 115 catalog.add(u'foo', locations=[('main.py', 1)])
116 catalog.add(u'foo', locations=[('utils.py', 3)]) 116 catalog.add(u'foo', locations=[('utils.py', 3)])
117 buf = StringIO() 117 buf = StringIO()
118 pofile.write_po(buf, catalog, omit_header=True) 118 pofile.write_po(buf, catalog, omit_header=True)
119 self.assertEqual('''#: main.py:1 utils.py:3 119 self.assertEqual('''#: main.py:1 utils.py:3
120 msgid "foo"
121 msgstr ""''', buf.getvalue().strip())
122
123 def test_duplicate_comments(self):
124 catalog = Catalog()
125 catalog.add(u'foo', auto_comments=['A comment'])
126 catalog.add(u'foo', auto_comments=['A comment'])
127 buf = StringIO()
128 pofile.write_po(buf, catalog, omit_header=True)
129 self.assertEqual('''#. A comment
120 msgid "foo" 130 msgid "foo"
121 msgstr ""''', buf.getvalue().strip()) 131 msgstr ""''', buf.getvalue().strip())
122 132
123 def test_wrap_long_lines(self): 133 def test_wrap_long_lines(self):
124 text = """Here's some text where 134 text = """Here's some text where
Copyright (C) 2012-2017 Edgewall Software