Skip to content

Commit 847d9db

Browse files
author
Richard Jones
committed
fixes to mailgw tests
1 parent 1808b50 commit 847d9db

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

test/test_mailgw.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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.35 2002-12-10 00:46:55 richard Exp $
11+
# $Id: test_mailgw.py,v 1.36 2002-12-11 03:17:50 richard Exp $
1212

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

@@ -31,19 +31,13 @@ def compareStrings(self, s2, s1):
3131
the first to be the "original" but in the calls in this file,
3232
the second arg is the original. Ho hum.
3333
'''
34-
if s1 == s2:
34+
# we have to special-case the Date: header here 'cos we can't test
35+
# for it properly
36+
l1=s1.strip().split('\n')
37+
l2=[x for x in s2.strip().split('\n') if not x.startswith('Date: ')]
38+
if l1 == l2:
3539
return
3640

37-
# under python2.[12] we allow a difference of one trailing empty line.
38-
if sys.version_info[0:2] == (2,1):
39-
if s1+'\n' == s2:
40-
return
41-
if sys.version_info[0:2] == (2,2):
42-
if s1 == s2+'\n':
43-
return
44-
45-
l1=s1.split('\n')
46-
l2=s2.split('\n')
4741
s = difflib.SequenceMatcher(None, l1, l2)
4842
res = ['Generated message not correct (diff follows):']
4943
for value, s1s, s1e, s2s, s2e in s.get_opcodes():

0 commit comments

Comments
 (0)