diff babel/messages/tests/pofile.py @ 103:7cdf89eb9007

Implement wrapping of header comments in PO(T) output. Related to #14.
author cmlenz
date Wed, 13 Jun 2007 21:46:41 +0000
parents 9c84b9fa5d30
children 22f222e23b86
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