Mercurial > p > roundup > code
annotate test/test_mailsplit.py @ 200:89c47b5dadac
er, removed the innocent from the the code :)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 03 Aug 2001 07:23:09 +0000 |
| parents | eda506860b32 |
| children | d702ac2ceedb |
| rev | line source |
|---|---|
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
1 # $Id: test_mailsplit.py,v 1.2 2001-08-03 07:23:09 richard Exp $ |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
2 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
3 import unittest, cStringIO |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
4 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
5 from roundup.mailgw import parseContent |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
6 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
7 class MailsplitTestCase(unittest.TestCase): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
8 def testPreComment(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
9 s = ''' |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
10 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
|
11 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
|
12 |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
13 issue_tracker@foo.com wrote: |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
14 > 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
|
15 > 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
|
16 > 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
|
17 > 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
|
18 > |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
19 > ------- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
20 > nosy: userfoo, userken |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
21 > _________________________________________________ |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
22 > Roundup issue tracker |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
23 > issue_tracker@foo.com |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
24 > 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
|
25 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
26 -- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
27 blah blah blah signature |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
28 userfoo@foo.com |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
29 ''' |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
30 summary, content = parseContent(s) |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
31 print '\n====\n', summary |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
32 print '====', content |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
33 print '====' |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
34 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
35 def testPostComment(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
36 s = ''' |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
37 issue_tracker@foo.com wrote: |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
38 > 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
|
39 > blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
40 > 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
|
41 > blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
42 > 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
|
43 > blah |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
44 > 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
|
45 > |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
46 > ------- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
47 > nosy: userfoo, userken |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
48 > _________________________________________________ |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
49 > Roundup issue tracker |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
50 > issue_tracker@foo.com |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
51 > 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
|
52 |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
53 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
|
54 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
|
55 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
56 -- |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
57 blah blah blah signature |
|
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
58 userfoo@foo.com |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
59 ''' |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
60 summary, content = parseContent(s) |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
61 print '\n====\n', summary |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
62 print '====', content |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
63 print '====' |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
64 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
65 def testSimple(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
66 s = '''testing''' |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
67 summary, content = parseContent(s) |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
68 print '\n====\n', summary |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
69 print '====', content |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
70 print '====' |
|
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 def testEmpty(self): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
73 s = '' |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
74 summary, content = parseContent(s) |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
75 print '\n====\n', summary |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
76 print '====', content |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
77 print '====' |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
78 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
79 def suite(): |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
80 return unittest.makeSuite(MailsplitTestCase, 'test') |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
81 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
82 |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
83 # |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
84 # $Log: not supported by cvs2svn $ |
|
200
89c47b5dadac
er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents:
198
diff
changeset
|
85 # 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
|
86 # 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
|
87 # 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
|
88 # |
|
198
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
89 # |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
90 # |
|
eda506860b32
Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff
changeset
|
91 # vim: set filetype=python ts=4 sw=4 et si |
