X-Git-Url: https://git.sommitrealweird.co.uk/rss2maildir.git/blobdiff_plain/738dfe9c90cc9a357a5236a77281be87c90a13e1..9a4c55083ef741cd562529f93b331f4c583e61b7:/tests/unittests/UnorderedListTests.py diff --git a/tests/unittests/UnorderedListTests.py b/tests/unittests/UnorderedListTests.py old mode 100644 new mode 100755 index af09b7c..4d2c393 --- a/tests/unittests/UnorderedListTests.py +++ b/tests/unittests/UnorderedListTests.py @@ -25,5 +25,23 @@ class UnorderedListTests(unittest.TestCase): output = parser.gettext() self.assertEqual(output, expectedoutput) + def testbadlyformed(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", "unorderedlist-badlyformed.html")).read() + expectedoutput = open(os.path.join(input_path, "expected", "unorderedlist-badlyformed.txt")).read() + parser = HTML2Text() + parser.feed(input) + output = parser.gettext() + self.assertEqual(output, expectedoutput) + if __name__ == "__main__": unittest.main()