diff babel/messages/tests/pofile.py @ 103:dacfbaf0d1e0 trunk

Implement wrapping of header comments in PO(T) output. Related to #14.
author cmlenz
date Wed, 13 Jun 2007 21:46:41 +0000
parents 116e34b8cefa
children 395704fda00b
line wrap: on
line diff
--- a/babel/messages/tests/pofile.py
+++ b/babel/messages/tests/pofile.py
@@ -68,6 +68,22 @@
 "loop\n"
 msgstr ""''', buf.getvalue().strip())
         
+    def test_wrap_long_lines_in_header(self):
+        """
+        Verify that long lines in the header comment are wrapped correctly.
+        """
+        catalog = Catalog(project='AReallyReallyLongNameForAProject')
+        buf = StringIO()
+        pofile.write_pot(buf, catalog)
+        self.assertEqual('''\
+# Translations template for AReallyReallyLongNameForAProject.
+# Copyright (C) 2007 ORGANIZATION
+# This file is distributed under the same license as the
+# AReallyReallyLongNameForAProject project.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy''', '\n'.join(buf.getvalue().splitlines()[:7]))
+
     def test_pot_with_translator_comments(self):
         catalog = Catalog()
         catalog.add(u'foo', locations=[('main.py', 1)],
Copyright (C) 2012-2017 Edgewall Software