Mercurial > p > roundup > code
annotate test/test_mailsplit.py @ 3682:193f316dbbe9
More transitive-property support.
- Implemented transitive properties in sort and group specs. Sort/group
specs can now be lists of specs.
- All regression tests except for one metakit backend test related to
metakit having no representation of NULL pass
- Fixed more PEP 8 whitespace peeves (and probably introduced some new
ones :-)
- Moved Proptree from support.py to hyperdb.py due to circular import
- Moved some proptree-specific methods from Class to Proptree
- Added a test for sorting by ids -> should be numeric sort (which now
really works for all backends)
- Added "required" attribute to all property classes in hyperdb (e.g.,
String, Link,...), see Feature Requests [SF#539081]
-> factored common stuff to _Type. Note that I also converted to a
new-style class when I was at it. Bad: The repr changes for new-style
classes which made some SQL backends break (!) because the repr of
Multilink is used in the schema storage. Fixed the repr to be
independent of the class type.
- Added get_required_props to Class. Todo: should also automagically
make the key property required...
- Add a sort_repr method to property classes. This defines the
sort-order. Individual backends may use diffent routines if the
outcome is the same. This one has a special case for id properties to
make the sorting numeric. Using these methods isn't mandatory in
backends as long as the sort-order is correct.
- Multilink sorting takes orderprop into account. It used to sort by
ids. You can restore the old behaviour by specifying id as the
orderprop of the Multilink if you really need that.
- If somebody specified a Link or Multilink as orderprop, we sort by
labelprop of that class -- not transitively by orderprop. I've
resited the tempation to implement recursive orderprop here: There
could even be loops if several classes specify a Link or Multilink as
the orderprop...
- Fixed a bug in Metakit-Backend: When sorting by Links, the backend
would do a natural join to the Link class. It would rename the "id"
attribute before joining but *not* all the other attributes of the
joined class. So in one test-case we had a name-clash with
priority.name and status.name when sorting *and* grouping by these
attributes. Depending on the order of joining this would produce a
name-clash with broken sort-results (and broken display if the
original class has an attribute that clashes). I'm now doing the
sorting of Links in the generic filter method for the metakit backend.
I've left the dead code in the metakit-backend since correctly
implementing this in the backend will probably be more efficient.
- updated doc/design.html with the new docstring of filter.
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Mon, 21 Aug 2006 12:19:48 +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 |
