Mercurial > p > roundup > code
annotate test/test_mailsplit.py @ 214:18134bffab37
stupid typo
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 07 Aug 2001 00:24:43 +0000 |
| parents | d45384bc6420 |
| children | 0ec8a9f1cbe6 |
| 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 # |
| 214 | 18 # $Id: test_mailsplit.py,v 1.5 2001-08-07 00:24:43 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 ''' |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
47 summary, content = parseContent(s) |
|
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 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
51 def testPostComment(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
52 s = ''' |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
53 issue_tracker@foo.com wrote: |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
54 > 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
|
55 > blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
56 > 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
|
57 > blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
58 > 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
|
59 > blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
60 > 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
|
61 > |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
62 > ------- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
63 > nosy: userfoo, userken |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
64 > _________________________________________________ |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
65 > Roundup issue tracker |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
66 > issue_tracker@foo.com |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
67 > 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
|
68 |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
69 blah blah blah blah... blah blah? blah blah blah blah blah. blah blah blah |
|
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! |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
71 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
72 -- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
73 blah blah blah signature |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
74 userfoo@foo.com |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
75 ''' |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
76 summary, content = parseContent(s) |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
77 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
|
78 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
|
79 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
80 def testSimple(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
81 s = '''testing''' |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
82 summary, content = parseContent(s) |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
83 self.assertEqual(summary, 'testing') |
|
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
84 self.assertEqual(content, 'testing') |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
85 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
86 def testEmpty(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
87 s = '' |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
88 summary, content = parseContent(s) |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
89 self.assertEqual(summary, '') |
|
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
90 self.assertEqual(content, '') |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
91 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
92 def suite(): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
93 return unittest.makeSuite(MailsplitTestCase, 'test') |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
94 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
95 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
96 # |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
97 # $Log: not supported by cvs2svn $ |
| 214 | 98 # Revision 1.4 2001/08/07 00:15:51 richard |
| 99 # Added the copyright/license notice to (nearly) all files at request of | |
| 100 # Bizar Software. | |
| 101 # | |
|
213
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
102 # Revision 1.3 2001/08/05 07:06:25 richard |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
103 # removed some print statements |
|
d45384bc6420
Added the copyright/license notice to (nearly) all files...
Richard Jones <richard@users.sourceforge.net>
parents:
202
diff
changeset
|
104 # |
|
202
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
105 # Revision 1.2 2001/08/03 07:23:09 richard |
|
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
106 # er, removed the innocent from the the code :) |
|
d702ac2ceedb
removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents:
200
diff
changeset
|
107 # |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
108 # Revision 1.1 2001/08/03 07:18:22 richard |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
109 # Implemented correct mail splitting (was taking a shortcut). Added unit |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
110 # tests. Also snips signatures now too. |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
111 # |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
112 # |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
113 # |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
114 # vim: set filetype=python ts=4 sw=4 et si |
