diff src/test/test_plugin_misc_text_syntaxes.py @ 841:831f208b4ea3

plugin text_syntaxes: html2text was breaking the long URLs
author souliane <souliane@mailoo.org>
date Thu, 13 Feb 2014 12:29:14 +0100
parents c4b22aedb7d7
children 7ea7053dda88
line wrap: on
line diff
--- a/src/test/test_plugin_misc_text_syntaxes.py	Thu Feb 13 10:42:29 2014 +0100
+++ b/src/test/test_plugin_misc_text_syntaxes.py	Thu Feb 13 12:29:14 2014 +0100
@@ -86,6 +86,15 @@
         d.addCallback(self.assertEqualXML, expected)
         return d
 
+    def test_html2text(self):
+        """Check that html2text is not inserting \n in the middle of that link.
+        By default lines are truncated after the 79th characters."""
+        source = "<img src=\"http://sat.goffi.org/static/images/screenshots/libervia/libervia_discussions.png\" alt=\"sat\"/>"
+        expected = "![sat](http://sat.goffi.org/static/images/screenshots/libervia/libervia_discussions.png)"
+        d = self.text_syntaxes.convert(source, self.text_syntaxes.SYNTAX_XHTML, self.text_syntaxes.SYNTAX_MARKDOWN)
+        d.addCallback(self.assertEqual, expected)
+        return d
+
     def test_removeXHTMLMarkups(self):
         expected = """ a link another link a paragraph secret EVIL! of EVIL! Password: annoying EVIL!spam spam SPAM! """
         result = self.text_syntaxes._removeMarkups(self.EVIL_HTML1)