Code

PGP support is again working (pyme API has changed significantly) and we
[roundup.git] / test / test_mailsplit.py
index ccfd84f2f4dfe6582d3213d512e10e8050c6d8f4..9c960df4357255621095bb4ea79a3a214ac781b1 100644 (file)
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: test_mailsplit.py,v 1.11 2002-09-10 00:19:55 richard Exp $
+# $Id: test_mailsplit.py,v 1.15 2003-10-25 22:53:26 richard Exp $
 
 import unittest, cStringIO
 
@@ -167,6 +167,11 @@ blah blah blah signature
 userfoo@foo.com
 ''')
 
+    def testAllQuoted(self):
+        s = '\nissue_tracker@foo.com wrote:\n> testing\n'
+        summary, content = parseContent(s, 0, 1)
+        self.assertEqual(summary, '')
+        self.assertEqual(content, s)
 
     def testSimple(self):
         s = '''testing'''
@@ -208,8 +213,27 @@ userfoo@foo.com
         summary, content = parseContent(s, 0, 0)
         self.assertEqual(content, s)
 
-def suite():
-   return unittest.makeSuite(MailsplitTestCase, 'test')
+    def testMultilineSummary(self):
+        s = 'This is a long sentence that would normally\nbe split. More words.'
+        summary, content = parseContent(s, 0, 0)
+        self.assertEqual(summary, 'This is a long sentence that would '
+            'normally\nbe split.')
+
+    def testKeepMultipleHyphens(self):
+        body = '''Testing, testing.
+
+----
+Testing, testing.'''
+        summary, content = parseContent(body, 1, 0)
+        self.assertEqual(body, content)
+
+def test_suite():
+    suite = unittest.TestSuite()
+    suite.addTest(unittest.makeSuite(MailsplitTestCase))
+    return suite
 
+if __name__ == '__main__':
+    runner = unittest.TextTestRunner()
+    unittest.main(testRunner=runner)
 
 # vim: set filetype=python ts=4 sw=4 et si