]> git.sommitrealweird.co.uk Git - rss2maildir.git/blobdiff - tests/unittests/ParagraphTests.py
Small fix to title handling code to deal with unicode better
[rss2maildir.git] / tests / unittests / ParagraphTests.py
index 9111ecdcf51ffc71d98bc07ebc352f749b1a9242..8b98a535a54d2669892be35ca9007c472ebc217f 100755 (executable)
@@ -4,26 +4,11 @@ import unittest
 import sys
 import os
 
-class ParagraphTests(unittest.TestCase):
-    def setUp(self):
-        self.inputpath = os.path.sep.join(os.path.dirname(os.path.realpath(__file__)).split(os.path.sep)[0:-1])
+import ParsingTests
 
+class ParagraphTests(ParsingTests.ParsingTest):
     def testWellFormedParagraphs(self):
-        try:
-            from rss2maildir import HTML2Text
-        except:
-            sys.path.append(os.path.sep.join(self.inputpath.split(os.path.sep)[0:-1]))
-            try:
-                from rss2maildir import HTML2Text
-            except:
-                self.assert_(False)
-        input_path = os.path.sep.join(os.path.dirname(os.path.realpath(__file__)).split(os.path.sep)[0:-1])
-        input = open(os.path.join(input_path, "html", "multiparagraph-wellformed.html")).read()
-        expectedoutput = open(os.path.join(input_path, "expected", "multiparagraph-wellformed.txt")).read()
-        parser = HTML2Text()
-        parser.feed(input)
-        output = parser.gettext()
-        self.assertEqual(output, expectedoutput)
+       return self.runParsingTest("multiparagraph-wellformed") 
 
 def suite():
     suite = unittest.TestSuite()