Mercurial > p > roundup > code
annotate test/test_mailsplit.py @ 3634:57c66056ffe4
Implemented what I'll call for now "transitive searching"...
...using the filter method. The first idea was mentioned on the
roundup-users mailing list:
http://article.gmane.org/gmane.comp.bug-tracking.roundup.user/6909
We can now search for items which link transitively to other classes
using filter. An example is searching for all items where a certain user
has added a message in the last week:
db.issue.filter (None, {'messages.author' : '42', 'messages.date' : '.-1w;'})
or more readable (but not exactly semantically equivalent, if you're
searching for multiple users in this way it will fail, because string
searches are ANDed): {'messages.author.username':'ralf', ...
We can even extend this further, look for all items that were changed by
users belonging to a certain department (having the same supervisor -- a
property that is not in the user class in standard roundup) in the last
week, the filterspec would be:
{'messages.author.supervisor' : '42', 'messages.date' : '.-1w;'}
If anybody wants to suggest another name instead of transitive
searching, you're welcome.
I've implemented a generic method for this in hyperdb.py -- the backend
now implements _filter in this case. With the generic method, anydbm and
metakit should work (anydbm is tested, metakit breaks for other
reasons). A backend may chose to implement the real transitive filter
itself. This was done for rdbms_common.py. It now has an implementation
of filter that supports transitive searching by creating one big join in
the generated SQL query.
I've added several new regression tests to test for the new features.
All the tests (not just the new ones) run through on python2.3 and
python2.4 with postgres, mysql, sqlite, anydbm -- but metakit was
already broken when I started.
I've generated a tag before commit called 'rsc_before_transitive_search'
and will create the 'after' tag after this commit, so you can merge out
my changes if you don't like them -- if you like them I can remove the
tags.
.-- Ralf
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Sat, 08 Jul 2006 18:28:18 +0000 |
| parents | f63aa57386b0 |
| children | 6e3e4f24c753 |
| 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. |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
17 # |
|
1873
f63aa57386b0
Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
1869
diff
changeset
|
18 # $Id: test_mailsplit.py,v 1.15 2003-10-25 22:53:26 richard Exp $ |
|
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 import unittest, cStringIO |
|
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 from roundup.mailgw import parseContent |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
23 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
24 class MailsplitTestCase(unittest.TestCase): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
25 def testPreComment(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
26 s = ''' |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
27 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
|
28 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
|
29 |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
30 issue_tracker@foo.com wrote: |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
31 > 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
|
32 > 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
|
33 > 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
|
34 > 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
|
35 > |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
36 > ------- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
37 > nosy: userfoo, userken |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
38 > _________________________________________________ |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
39 > Roundup issue tracker |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
40 > issue_tracker@foo.com |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
41 > 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
|
42 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
43 -- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
44 blah blah blah signature |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
45 userfoo@foo.com |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
46 ''' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
47 summary, content = parseContent(s, 0, 0) |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
48 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
|
49 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
|
50 |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
51 |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
52 def testPostComment(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
53 s = ''' |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
54 issue_tracker@foo.com wrote: |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
55 > 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
|
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 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 |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
60 > blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
61 > 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
|
62 > |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
63 > ------- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
64 > nosy: userfoo, userken |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
65 > _________________________________________________ |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
66 > Roundup issue tracker |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
67 > issue_tracker@foo.com |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
68 > 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
|
69 |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
70 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
|
71 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
|
72 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
73 -- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
74 blah blah blah signature |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
75 userfoo@foo.com |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
76 ''' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
77 summary, content = parseContent(s, 0, 0) |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
78 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
|
79 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
|
80 |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
81 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
82 def testKeepCitation(self): |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
83 s = ''' |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
84 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
|
85 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
|
86 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
87 issue_tracker@foo.com wrote: |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
88 > 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
|
89 > 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
|
90 > 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
|
91 > 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
|
92 > |
|
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 > nosy: userfoo, userken |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
95 > _________________________________________________ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
96 > Roundup issue tracker |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
97 > issue_tracker@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
98 > 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
|
99 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
100 -- |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
101 blah blah blah signature |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
102 userfoo@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
103 ''' |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
104 summary, content = parseContent(s, 1, 0) |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
105 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
|
106 self.assertEqual(content, '''\ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
107 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
|
108 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
|
109 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
110 issue_tracker@foo.com wrote: |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
111 > 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
|
112 > 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
|
113 > 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
|
114 > 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
|
115 > |
|
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 > nosy: userfoo, userken |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
118 > _________________________________________________ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
119 > Roundup issue tracker |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
120 > issue_tracker@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
121 > 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
|
122 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
123 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
124 def testKeepBody(self): |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
125 s = ''' |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
126 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
|
127 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
|
128 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
129 issue_tracker@foo.com wrote: |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
130 > 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
|
131 > 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
|
132 > 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
|
133 > 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
|
134 > |
|
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 > nosy: userfoo, userken |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
137 > _________________________________________________ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
138 > Roundup issue tracker |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
139 > issue_tracker@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
140 > 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
|
141 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
142 -- |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
143 blah blah blah signature |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
144 userfoo@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
145 ''' |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
146 summary, content = parseContent(s, 0, 1) |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
147 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
|
148 self.assertEqual(content, ''' |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
149 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
|
150 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
|
151 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
152 issue_tracker@foo.com wrote: |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
153 > 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
|
154 > 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
|
155 > 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
|
156 > 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
|
157 > |
|
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 > nosy: userfoo, userken |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
160 > _________________________________________________ |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
161 > Roundup issue tracker |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
162 > issue_tracker@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
163 > 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
|
164 |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
165 -- |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
166 blah blah blah signature |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
167 userfoo@foo.com |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
168 ''') |
|
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
169 |
|
1822
7e32c7663781
added test to confirm behaviour of summary generation from quoted-only email
Richard Jones <richard@users.sourceforge.net>
parents:
1291
diff
changeset
|
170 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
|
171 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
|
172 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
|
173 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
|
174 self.assertEqual(content, s) |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
175 |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
176 def testSimple(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
177 s = '''testing''' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
178 summary, content = parseContent(s, 0, 0) |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
179 self.assertEqual(summary, 'testing') |
|
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
180 self.assertEqual(content, 'testing') |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
181 |
|
310
0ec8a9f1cbe6
[SF#473125]: Paragraph in e-mails
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
182 def testParagraphs(self): |
|
0ec8a9f1cbe6
[SF#473125]: Paragraph in e-mails
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
183 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
|
184 summary, content = parseContent(s, 0, 0) |
|
310
0ec8a9f1cbe6
[SF#473125]: Paragraph in e-mails
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
185 self.assertEqual(summary, 'testing') |
|
0ec8a9f1cbe6
[SF#473125]: Paragraph in e-mails
Richard Jones <richard@users.sourceforge.net>
parents:
214
diff
changeset
|
186 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
|
187 |
|
510
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
188 def testSimpleFollowup(self): |
|
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
189 s = '''>hello\ntesting''' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
190 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
|
191 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
|
192 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
|
193 |
|
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
194 def testSimpleFollowupParas(self): |
|
3f6107488465
followup lines directly after a quoted section were being eaten.
Richard Jones <richard@users.sourceforge.net>
parents:
334
diff
changeset
|
195 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
|
196 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
|
197 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
|
198 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
|
199 |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
200 def testEmpty(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
201 s = '' |
|
695
d524e5b52061
Sorry, forgot to checkin modified unit tests...
Roche Compaan <rochecompaan@users.sourceforge.net>
parents:
510
diff
changeset
|
202 summary, content = parseContent(s, 0, 0) |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
203 self.assertEqual(summary, '') |
|
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
204 self.assertEqual(content, '') |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
205 |
|
334
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
206 def testIndentationSummary(self): |
|
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
207 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
|
208 summary, content = parseContent(s, 0, 0) |
|
334
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
209 self.assertEqual(summary, ' Four space indent.') |
|
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
210 |
|
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
211 def testIndentationContent(self): |
|
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
212 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
|
213 summary, content = parseContent(s, 0, 0) |
|
334
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
214 self.assertEqual(content, s) |
|
256776bfdfc5
fixed [SF#474749] Indentations lost
Richard Jones <richard@users.sourceforge.net>
parents:
317
diff
changeset
|
215 |
|
1291
bf8b2380adb3
added CGI :remove:<propname> and :add:<propname>...
Richard Jones <richard@users.sourceforge.net>
parents:
1090
diff
changeset
|
216 def testMultilineSummary(self): |
|
bf8b2380adb3
added CGI :remove:<propname> and :add:<propname>...
Richard Jones <richard@users.sourceforge.net>
parents:
1090
diff
changeset
|
217 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
|
218 summary, content = parseContent(s, 0, 0) |
|
bf8b2380adb3
added CGI :remove:<propname> and :add:<propname>...
Richard Jones <richard@users.sourceforge.net>
parents:
1090
diff
changeset
|
219 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
|
220 'normally\nbe split.') |
|
bf8b2380adb3
added CGI :remove:<propname> and :add:<propname>...
Richard Jones <richard@users.sourceforge.net>
parents:
1090
diff
changeset
|
221 |
|
1869
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
222 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
|
223 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
|
224 |
|
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
225 ---- |
|
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
226 Testing, testing.''' |
|
3260268e45d2
Move tests to test_mailsplit, which I hadn't seen before
Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
parents:
1822
diff
changeset
|
227 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
|
228 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
|
229 |
|
1873
f63aa57386b0
Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
1869
diff
changeset
|
230 def test_suite(): |
|
f63aa57386b0
Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
1869
diff
changeset
|
231 suite = unittest.TestSuite() |
|
f63aa57386b0
Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
1869
diff
changeset
|
232 suite.addTest(unittest.makeSuite(MailsplitTestCase)) |
|
f63aa57386b0
Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
1869
diff
changeset
|
233 return suite |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
234 |
|
1873
f63aa57386b0
Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
1869
diff
changeset
|
235 if __name__ == '__main__': |
|
f63aa57386b0
Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
1869
diff
changeset
|
236 runner = unittest.TextTestRunner() |
|
f63aa57386b0
Backend improvements.
Richard Jones <richard@users.sourceforge.net>
parents:
1869
diff
changeset
|
237 unittest.main(testRunner=runner) |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
238 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
239 # vim: set filetype=python ts=4 sw=4 et si |
