Mercurial > p > roundup > code
annotate test/test_mailsplit.py @ 8456:9f7e863fd1cd
merge multiple fix: python < 3.12 returns ParsingError not RuntimeError; print exception
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Mon, 22 Sep 2025 14:08:36 -0400 |
| parents | 55f09ca366c4 |
| children |
| rev | line source |
|---|---|
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
1 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
2 # Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/) |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
3 # This module is free software, and you may redistribute it and/or modify |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
4 # under the same terms as Python, so long as this copyright message and |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
5 # disclaimer are retained in their original form. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
6 # |
| 214 | 7 # IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
8 # DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
9 # OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
10 # POSSIBILITY OF SUCH DAMAGE. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
11 # |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
12 # BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
17 |
|
5418
55f09ca366c4
Python 3 preparation: StringIO.
Joseph Myers <jsm@polyomino.org.uk>
parents:
5037
diff
changeset
|
18 import unittest |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
19 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
20 from roundup.mailgw import parseContent |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
21 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
22 class MailsplitTestCase(unittest.TestCase): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
23 def testPreComment(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
24 s = ''' |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
25 blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
26 blah blah blah blah blah blah blah blah blah blah blah! |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
27 |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
28 issue_tracker@foo.com wrote: |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
29 > blah blah blah blahblah blahblah blahblah blah blah blah blah blah blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
30 > blah blah blah blah blah blah blah blah blah? blah blah blah blah blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
31 > blah blah blah blah blah blah blah... blah blah blah blah. blah blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
32 > blah blah blah blah? blah blah blah blah blah blah! blah blah! |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
33 > |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
34 > ------- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
35 > nosy: userfoo, userken |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
36 > _________________________________________________ |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
37 > Roundup issue tracker |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
38 > issue_tracker@foo.com |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
39 > http://foo.com/cgi-bin/roundup.cgi/issue_tracker/ |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
40 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
41 -- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
42 blah blah blah signature |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
43 userfoo@foo.com |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
44 ''' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
45 summary, content = parseContent(s, 0, 0) |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
46 self.assertEqual(summary, 'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah') |
|
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
47 self.assertEqual(content, 'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah\nblah blah blah blah blah blah blah blah blah blah blah!') |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
48 |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
49 |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
50 def testPostComment(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
51 s = ''' |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
52 issue_tracker@foo.com wrote: |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
53 > blah blah blah blahblah blahblah blahblah blah blah blah blah blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
54 > blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
55 > blah blah blah blah blah blah blah blah blah? blah blah blah blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
56 > blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
57 > blah blah blah blah blah blah blah... blah blah blah blah. blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
58 > blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
59 > blah blah blah blah? blah blah blah blah blah blah! blah blah! |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
60 > |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
61 > ------- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
62 > nosy: userfoo, userken |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
63 > _________________________________________________ |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
64 > Roundup issue tracker |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
65 > issue_tracker@foo.com |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
66 > http://foo.com/cgi-bin/roundup.cgi/issue_tracker/ |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
67 |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
68 blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
69 blah blah blah blah blah blah blah blah blah blah blah! |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
70 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
71 -- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
72 blah blah blah signature |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
73 userfoo@foo.com |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
74 ''' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
75 summary, content = parseContent(s, 0, 0) |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
76 self.assertEqual(summary, 'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah') |
|
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
77 self.assertEqual(content, 'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah\nblah blah blah blah blah blah blah blah blah blah blah!') |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
78 |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
79 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
80 def testKeepCitation(self): |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
81 s = ''' |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
82 blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
83 blah blah blah blah blah blah blah blah blah blah blah! |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
84 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
85 issue_tracker@foo.com wrote: |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
86 > blah blah blah blahblah blahblah blahblah blah blah blah blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
87 > blah blah blah blah blah blah blah blah blah? blah blah blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
88 > blah blah blah blah blah blah blah... blah blah blah blah. blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
89 > blah blah blah blah? blah blah blah blah blah blah! blah blah! |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
90 > |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
91 > ------- |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
92 > nosy: userfoo, userken |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
93 > _________________________________________________ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
94 > Roundup issue tracker |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
95 > issue_tracker@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
96 > http://foo.com/cgi-bin/roundup.cgi/issue_tracker/ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
97 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
98 -- |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
99 blah blah blah signature |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
100 userfoo@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
101 ''' |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
102 summary, content = parseContent(s, 1, 0) |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
103 self.assertEqual(summary, 'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah') |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
104 self.assertEqual(content, '''\ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
105 blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
106 blah blah blah blah blah blah blah blah blah blah blah! |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
107 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
108 issue_tracker@foo.com wrote: |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
109 > blah blah blah blahblah blahblah blahblah blah blah blah blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
110 > blah blah blah blah blah blah blah blah blah? blah blah blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
111 > blah blah blah blah blah blah blah... blah blah blah blah. blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
112 > blah blah blah blah? blah blah blah blah blah blah! blah blah! |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
113 > |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
114 > ------- |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
115 > nosy: userfoo, userken |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
116 > _________________________________________________ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
117 > Roundup issue tracker |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
118 > issue_tracker@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
119 > http://foo.com/cgi-bin/roundup.cgi/issue_tracker/''') |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
120 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
121 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
122 def testKeepBody(self): |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
123 s = ''' |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
124 blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
125 blah blah blah blah blah blah blah blah blah blah blah! |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
126 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
127 issue_tracker@foo.com wrote: |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
128 > blah blah blah blahblah blahblah blahblah blah blah blah blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
129 > blah blah blah blah blah blah blah blah blah? blah blah blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
130 > blah blah blah blah blah blah blah... blah blah blah blah. blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
131 > blah blah blah blah? blah blah blah blah blah blah! blah blah! |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
132 > |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
133 > ------- |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
134 > nosy: userfoo, userken |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
135 > _________________________________________________ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
136 > Roundup issue tracker |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
137 > issue_tracker@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
138 > http://foo.com/cgi-bin/roundup.cgi/issue_tracker/ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
139 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
140 -- |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
141 blah blah blah signature |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
142 userfoo@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
143 ''' |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
144 summary, content = parseContent(s, 0, 1) |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
145 self.assertEqual(summary, 'blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah') |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
146 self.assertEqual(content, ''' |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
147 blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
148 blah blah blah blah blah blah blah blah blah blah blah! |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
149 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
150 issue_tracker@foo.com wrote: |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
151 > blah blah blah blahblah blahblah blahblah blah blah blah blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
152 > blah blah blah blah blah blah blah blah blah? blah blah blah blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
153 > blah blah blah blah blah blah blah... blah blah blah blah. blah blah |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
154 > blah blah blah blah? blah blah blah blah blah blah! blah blah! |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
155 > |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
156 > ------- |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
157 > nosy: userfoo, userken |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
158 > _________________________________________________ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
159 > Roundup issue tracker |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
160 > issue_tracker@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
161 > http://foo.com/cgi-bin/roundup.cgi/issue_tracker/ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
162 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
163 -- |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
164 blah blah blah signature |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
165 userfoo@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
166 ''') |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
167 |
|
1822
7e32c7663781
added test to confirm behaviour of summary generation from quoted-only email
Richard Jones <richard@users.sourceforge.net>
parents:
1291
diff
changeset
|
168 def testAllQuoted(self): |
|
7e32c7663781
added test to confirm behaviour of summary generation from quoted-only email
Richard Jones <richard@users.sourceforge.net>
parents:
1291
diff
changeset
|
169 s = '\nissue_tracker@foo.com wrote:\n> testing\n' |
|
7e32c7663781
added test to confirm behaviour of summary generation from quoted-only email
Richard Jones <richard@users.sourceforge.net>
parents:
1291
diff
changeset
|
170 summary, content = parseContent(s, 0, 1) |
|
7e32c7663781
added test to confirm behaviour of summary generation from quoted-only email
Richard Jones <richard@users.sourceforge.net>
parents:
1291
diff
changeset
|
171 self.assertEqual(summary, '') |
|
7e32c7663781
added test to confirm behaviour of summary generation from quoted-only email
Richard Jones <richard@users.sourceforge.net>
parents:
1291
diff
changeset
|
172 self.assertEqual(content, s) |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
173 |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
174 def testSimple(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
175 s = '''testing''' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
176 summary, content = parseContent(s, 0, 0) |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
177 self.assertEqual(summary, 'testing') |
|
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
178 self.assertEqual(content, 'testing') |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
179 |
|
310
0ec8a9f1cbe6
[SF#473125]: Paragraph in e-mails
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
180 def testParagraphs(self): |
|
0ec8a9f1cbe6
[SF#473125]: Paragraph in e-mails
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
181 s = '''testing\n\ntesting\n\ntesting''' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
182 summary, content = parseContent(s, 0, 0) |
|
310
0ec8a9f1cbe6
[SF#473125]: Paragraph in e-mails
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
183 self.assertEqual(summary, 'testing') |
|
0ec8a9f1cbe6
[SF#473125]: Paragraph in e-mails
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
184 self.assertEqual(content, 'testing\n\ntesting\n\ntesting') |
|
0ec8a9f1cbe6
[SF#473125]: Paragraph in e-mails
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
185 |
|
510
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
186 def testSimpleFollowup(self): |
|
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
187 s = '''>hello\ntesting''' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
188 summary, content = parseContent(s, 0, 0) |
|
510
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
189 self.assertEqual(summary, 'testing') |
|
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
190 self.assertEqual(content, 'testing') |
|
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
191 |
|
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
192 def testSimpleFollowupParas(self): |
|
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
193 s = '''>hello\ntesting\n\ntesting\n\ntesting''' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
194 summary, content = parseContent(s, 0, 0) |
|
510
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
195 self.assertEqual(summary, 'testing') |
|
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
196 self.assertEqual(content, 'testing\n\ntesting\n\ntesting') |
|
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
197 |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
198 def testEmpty(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
199 s = '' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
200 summary, content = parseContent(s, 0, 0) |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
201 self.assertEqual(summary, '') |
|
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
202 self.assertEqual(content, '') |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
203 |
|
334
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
204 def testIndentationSummary(self): |
|
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
205 s = ' Four space indent.\n\n Four space indent.\nNo indent.' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
206 summary, content = parseContent(s, 0, 0) |
|
334
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
207 self.assertEqual(summary, ' Four space indent.') |
|
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
208 |
|
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
209 def testIndentationContent(self): |
|
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
210 s = ' Four space indent.\n\n Four space indent.\nNo indent.' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
211 summary, content = parseContent(s, 0, 0) |
|
334
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
212 self.assertEqual(content, s) |
|
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
213 |
|
1291
bf8b2380adb3
added CGI :remove:<propname> and :add:<propname>...
Richard Jones <richard@users.sourceforge.net>
parents:
1090
diff
changeset
|
214 def testMultilineSummary(self): |
|
bf8b2380adb3
added CGI :remove:<propname> and :add:<propname>...
Richard Jones <richard@users.sourceforge.net>
parents:
1090
diff
changeset
|
215 s = 'This is a long sentence that would normally\nbe split. More words.' |
|
bf8b2380adb3
added CGI :remove:<propname> and :add:<propname>...
Richard Jones <richard@users.sourceforge.net>
parents:
1090
diff
changeset
|
216 summary, content = parseContent(s, 0, 0) |
|
bf8b2380adb3
added CGI :remove:<propname> and :add:<propname>...
Richard Jones <richard@users.sourceforge.net>
parents:
1090
diff
changeset
|
217 self.assertEqual(summary, 'This is a long sentence that would ' |
|
bf8b2380adb3
added CGI :remove:<propname> and :add:<propname>...
Richard Jones <richard@users.sourceforge.net>
parents:
1090
diff
changeset
|
218 'normally\nbe split.') |
|
bf8b2380adb3
added CGI :remove:<propname> and :add:<propname>...
Richard Jones <richard@users.sourceforge.net>
parents:
1090
diff
changeset
|
219 |
|
1869
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
220 def testKeepMultipleHyphens(self): |
|
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
221 body = '''Testing, testing. |
|
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
222 |
|
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
223 ---- |
|
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
224 Testing, testing.''' |
|
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
225 summary, content = parseContent(body, 1, 0) |
|
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
226 self.assertEqual(body, content) |
|
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
227 |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
228 # vim: set filetype=python ts=4 sw=4 et si |
