Skip to content

Commit ee34355

Browse files
author
Derrick Hudson
committed
Updated message strings...
...to match the RFC822 address quoting performed by the 'email' and 'rfc822' modules. The verification really should use a RFC2822 message parser rather than literal string comparisions to allow for legal variations in messages.
1 parent ead73ce commit ee34355

File tree

1 file changed

+47
-27
lines changed

1 file changed

+47
-27
lines changed

test/test_mailgw.py

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,18 @@
88
# but WITHOUT ANY WARRANTY; without even the implied warranty of
99
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1010
#
11-
# $Id: test_mailgw.py,v 1.20 2002-05-29 01:16:17 richard Exp $
11+
# $Id: test_mailgw.py,v 1.21 2002-06-18 03:59:59 dman13 Exp $
1212

1313
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
1414

15+
# Note: Should parse emails according to RFC2822 instead of performing a
16+
# literal string comparision. Parsing the messages allows the tests to work for
17+
# any legal serialization of an email.
18+
#try :
19+
# import email
20+
#except ImportError :
21+
# import rfc822 as email
22+
1523
from roundup.mailgw import MailGW
1624
from roundup import init, instance
1725

@@ -89,7 +97,7 @@ def tearDown(self):
8997
def doNewIssue(self):
9098
message = cStringIO.StringIO('''Content-Type: text/plain;
9199
charset="iso-8859-1"
92-
From: Chef <[email protected]
100+
From: Chef <[email protected]>
93101
94102
Cc: richard@test
95103
Message-Id: <dummy_test_message_id>
@@ -113,7 +121,7 @@ def testNewIssueNosy(self):
113121
self.instance.ADD_AUTHOR_TO_NOSY = 'yes'
114122
message = cStringIO.StringIO('''Content-Type: text/plain;
115123
charset="iso-8859-1"
116-
From: Chef <[email protected]
124+
From: Chef <[email protected]>
117125
118126
Cc: richard@test
119127
Message-Id: <dummy_test_message_id>
@@ -152,7 +160,7 @@ def testAlternateAddress(self):
152160
def testNewIssueNoClass(self):
153161
message = cStringIO.StringIO('''Content-Type: text/plain;
154162
charset="iso-8859-1"
155-
From: Chef <[email protected]
163+
From: Chef <[email protected]>
156164
157165
Cc: richard@test
158166
Message-Id: <dummy_test_message_id>
@@ -169,7 +177,7 @@ def testNewIssueNoClass(self):
169177
def testNewIssueAuthMsg(self):
170178
message = cStringIO.StringIO('''Content-Type: text/plain;
171179
charset="iso-8859-1"
172-
From: Chef <[email protected]
180+
From: Chef <[email protected]>
173181
174182
Message-Id: <dummy_test_message_id>
175183
Subject: [issue] Testing... [nosy=mary; assignedto=richard]
@@ -187,8 +195,8 @@ def testNewIssueAuthMsg(self):
187195
Content-Type: text/plain
188196
Subject: [issue1] Testing...
189197
To: [email protected], mary@test, richard@test
190-
From: Chef <[email protected]>
191-
Reply-To: Roundup issue tracker <[email protected]>
198+
From: "Chef" <[email protected]>
199+
Reply-To: "Roundup issue tracker" <[email protected]>
192200
MIME-Version: 1.0
193201
Message-Id: <dummy_test_message_id>
194202
X-Roundup-Name: Roundup issue tracker
@@ -241,8 +249,8 @@ def testSimpleFollowup(self):
241249
Content-Type: text/plain
242250
Subject: [issue1] Testing...
243251
To: [email protected], richard@test
244-
From: mary <[email protected]>
245-
Reply-To: Roundup issue tracker <[email protected]>
252+
From: "mary" <[email protected]>
253+
Reply-To: "Roundup issue tracker" <[email protected]>
246254
MIME-Version: 1.0
247255
Message-Id: <followup_dummy_id>
248256
In-Reply-To: <dummy_test_message_id>
@@ -288,8 +296,8 @@ def testFollowup(self):
288296
Content-Type: text/plain
289297
Subject: [issue1] Testing...
290298
To: [email protected], john@test, mary@test
291-
From: richard <[email protected]>
292-
Reply-To: Roundup issue tracker <[email protected]>
299+
From: "richard" <[email protected]>
300+
Reply-To: "Roundup issue tracker" <[email protected]>
293301
MIME-Version: 1.0
294302
Message-Id: <followup_dummy_id>
295303
In-Reply-To: <dummy_test_message_id>
@@ -333,8 +341,8 @@ def testFollowupTitleMatch(self):
333341
Content-Type: text/plain
334342
Subject: [issue1] Testing...
335343
To: [email protected], john@test, mary@test
336-
From: richard <[email protected]>
337-
Reply-To: Roundup issue tracker <[email protected]>
344+
From: "richard" <[email protected]>
345+
Reply-To: "Roundup issue tracker" <[email protected]>
338346
MIME-Version: 1.0
339347
Message-Id: <followup_dummy_id>
340348
In-Reply-To: <dummy_test_message_id>
@@ -379,8 +387,8 @@ def testFollowupNosyAuthor(self):
379387
Content-Type: text/plain
380388
Subject: [issue1] Testing...
381389
To: [email protected], richard@test
382-
From: john <[email protected]>
383-
Reply-To: Roundup issue tracker <[email protected]>
390+
From: "john" <[email protected]>
391+
Reply-To: "Roundup issue tracker" <[email protected]>
384392
MIME-Version: 1.0
385393
Message-Id: <followup_dummy_id>
386394
In-Reply-To: <dummy_test_message_id>
@@ -426,8 +434,8 @@ def testFollowupNosyRecipients(self):
426434
Content-Type: text/plain
427435
Subject: [issue1] Testing...
428436
429-
From: richard <[email protected]>
430-
Reply-To: Roundup issue tracker <[email protected]>
437+
From: "richard" <[email protected]>
438+
Reply-To: "Roundup issue tracker" <[email protected]>
431439
MIME-Version: 1.0
432440
Message-Id: <followup_dummy_id>
433441
In-Reply-To: <dummy_test_message_id>
@@ -473,8 +481,8 @@ def testFollowupNosyAuthorAndCopy(self):
473481
Content-Type: text/plain
474482
Subject: [issue1] Testing...
475483
To: [email protected], john@test, richard@test
476-
From: john <[email protected]>
477-
Reply-To: Roundup issue tracker <[email protected]>
484+
From: "john" <[email protected]>
485+
Reply-To: "Roundup issue tracker" <[email protected]>
478486
MIME-Version: 1.0
479487
Message-Id: <followup_dummy_id>
480488
In-Reply-To: <dummy_test_message_id>
@@ -519,8 +527,8 @@ def testFollowupNoNosyAuthor(self):
519527
Content-Type: text/plain
520528
Subject: [issue1] Testing...
521529
To: [email protected], richard@test
522-
From: john <[email protected]>
523-
Reply-To: Roundup issue tracker <[email protected]>
530+
From: "john" <[email protected]>
531+
Reply-To: "Roundup issue tracker" <[email protected]>
524532
MIME-Version: 1.0
525533
Message-Id: <followup_dummy_id>
526534
In-Reply-To: <dummy_test_message_id>
@@ -565,8 +573,8 @@ def testFollowupNoNosyRecipients(self):
565573
Content-Type: text/plain
566574
Subject: [issue1] Testing...
567575
568-
From: richard <[email protected]>
569-
Reply-To: Roundup issue tracker <[email protected]>
576+
From: "richard" <[email protected]>
577+
Reply-To: "Roundup issue tracker" <[email protected]>
570578
MIME-Version: 1.0
571579
Message-Id: <followup_dummy_id>
572580
In-Reply-To: <dummy_test_message_id>
@@ -633,8 +641,8 @@ def testEnc01(self):
633641
Content-Type: text/plain
634642
Subject: [issue1] Testing...
635643
To: [email protected], richard@test
636-
From: mary <[email protected]>
637-
Reply-To: Roundup issue tracker <[email protected]>
644+
From: "mary" <[email protected]>
645+
Reply-To: "Roundup issue tracker" <[email protected]>
638646
MIME-Version: 1.0
639647
Message-Id: <followup_dummy_id>
640648
In-Reply-To: <dummy_test_message_id>
@@ -686,8 +694,8 @@ def testMultipartEnc01(self):
686694
Content-Type: text/plain
687695
Subject: [issue1] Testing...
688696
To: [email protected], richard@test
689-
From: mary <[email protected]>
690-
Reply-To: Roundup issue tracker <[email protected]>
697+
From: "mary" <[email protected]>
698+
Reply-To: "Roundup issue tracker" <[email protected]>
691699
MIME-Version: 1.0
692700
Message-Id: <followup_dummy_id>
693701
In-Reply-To: <dummy_test_message_id>
@@ -719,6 +727,18 @@ def suite():
719727

720728
#
721729
# $Log: not supported by cvs2svn $
730+
# Revision 1.20 2002/05/29 01:16:17 richard
731+
# Sorry about this huge checkin! It's fixing a lot of related stuff in one go
732+
# though.
733+
#
734+
# . #541941 ] changing multilink properties by mail
735+
# . #526730 ] search for messages capability
736+
# . #505180 ] split MailGW.handle_Message
737+
# - also changed cgi client since it was duplicating the functionality
738+
# . build htmlbase if tests are run using CVS checkout (removed note from
739+
# installation.txt)
740+
# . don't create an empty message on email issue creation if the email is empty
741+
#
722742
# Revision 1.19 2002/05/23 04:26:05 richard
723743
# 'I must run unit tests before committing\n' * 100
724744
#

0 commit comments

Comments
 (0)