annotate test/test_mailsplit.py @ 202:d702ac2ceedb

removed some print statements
author Richard Jones <richard@users.sourceforge.net>
date Sun, 05 Aug 2001 07:06:25 +0000
parents 89c47b5dadac
children d45384bc6420
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
202
d702ac2ceedb removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents: 200
diff changeset
1 # $Id: test_mailsplit.py,v 1.3 2001-08-05 07:06:25 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)
202
d702ac2ceedb removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents: 200
diff changeset
31 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
32 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
33
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
34 def testPostComment(self):
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
35 s = '''
200
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
36 issue_tracker@foo.com wrote:
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
37 > 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
38 > blah
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
39 > 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
40 > blah
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
41 > 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
42 > blah
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
43 > 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
44 >
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
45 > -------
200
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
46 > nosy: userfoo, userken
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
47 > _________________________________________________
198
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
48 > Roundup issue tracker
200
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
49 > issue_tracker@foo.com
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
50 > 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
51
200
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
52 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
53 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
54
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
55 --
200
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
56 blah blah blah signature
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
57 userfoo@foo.com
198
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
58 '''
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
59 summary, content = parseContent(s)
202
d702ac2ceedb removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents: 200
diff changeset
60 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
61 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
62
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
63 def testSimple(self):
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
64 s = '''testing'''
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
65 summary, content = parseContent(s)
202
d702ac2ceedb removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents: 200
diff changeset
66 self.assertEqual(summary, 'testing')
d702ac2ceedb removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents: 200
diff changeset
67 self.assertEqual(content, 'testing')
198
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
68
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
69 def testEmpty(self):
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
70 s = ''
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
71 summary, content = parseContent(s)
202
d702ac2ceedb removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents: 200
diff changeset
72 self.assertEqual(summary, '')
d702ac2ceedb removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents: 200
diff changeset
73 self.assertEqual(content, '')
198
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
74
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
75 def suite():
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
76 return unittest.makeSuite(MailsplitTestCase, 'test')
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
77
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 #
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
80 # $Log: not supported by cvs2svn $
202
d702ac2ceedb removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents: 200
diff changeset
81 # 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
82 # er, removed the innocent from the the code :)
d702ac2ceedb removed some print statements
Richard Jones <richard@users.sourceforge.net>
parents: 200
diff changeset
83 #
200
89c47b5dadac er, removed the innocent from the the code :)
Richard Jones <richard@users.sourceforge.net>
parents: 198
diff changeset
84 # 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
85 # 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
86 # 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
87 #
198
eda506860b32 Implemented correct mail splitting (was taking a shortcut).
Richard Jones <richard@users.sourceforge.net>
parents:
diff changeset
88 #
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 # vim: set filetype=python ts=4 sw=4 et si

Roundup Issue Tracker: http://roundup-tracker.org/