Skip to content

Commit fccd35e

Browse files
committed
compare folded headers in mailgw tests
1 parent 7ff5359 commit fccd35e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/test_mailgw.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ def get_body(message):
5656

5757
return message.as_string().split('\n\n', 1)[-1]
5858

59+
def unfold(lst):
60+
return [l.replace('\n', '') for l in lst]
61+
5962

6063
class Tracker(object):
6164
def open(self, journaltag):
@@ -131,7 +134,7 @@ def compareMessages(self, new, old):
131134
res.append('content-type mime type headers differ new vs. reference: %r != %r'%(newmimetype, oldmimetype))
132135
replace ['--' + newmimeboundary] = '--' + oldmimeboundary
133136
replace ['--' + newmimeboundary + '--'] = '--' + oldmimeboundary + '--'
134-
elif new.get_all(key, '') != old.get_all(key, ''):
137+
elif unfold(new.get_all(key, '')) != unfold(old.get_all(key, '')):
135138
# check that all other headers are identical, including
136139
# headers that appear more than once.
137140
res.append(' %s: %r != %r' % (key, old.get_all(key, ''),

0 commit comments

Comments
 (0)