Skip to content
Snippets Groups Projects
Commit 18186a3c authored by Stuart D. Gathman's avatar Stuart D. Gathman
Browse files

Read header encoding tests as binary

parent a01f598e
No related branches found
No related tags found
No related merge requests found
......@@ -270,6 +270,7 @@ class TestCtx(object):
if rc != Milter.CONTINUE: return rc
# header
for h,val in msg.items():
# val is a Header object for invalid header values
rc = self._header(h,val)
if rc != Milter.CONTINUE: return rc
# eoh
......
......@@ -29,10 +29,10 @@ class BMSMilterTestCase(unittest.TestCase):
ctx._setsymval('j','mailhost')
rc = ctx._connect()
self.assertTrue(rc == Milter.CONTINUE)
with open('test/'+fname) as fp:
with open('test/'+fname,'rb') as fp:
rc = ctx._feedFile(fp)
milter = ctx.getpriv()
self.assertFalse(ctx._bodyreplaced,"Message body not replaced")
self.assertFalse(ctx._bodyreplaced,"Message body replaced")
fp = ctx._body
with open('test/'+fname+".tstout","wb") as ofp:
ofp.write(fp.getvalue())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment