diff --git a/Milter/testctx.py b/Milter/testctx.py
index b50dbb88941757960a0207950792d522d96b07cd..05d36691384d3ab75f8f1887f9a2082f81ee1c22 100644
--- a/Milter/testctx.py
+++ b/Milter/testctx.py
@@ -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
diff --git a/testsample.py b/testsample.py
index ce8ebb1a5614918aa0535e9b0cff1e7be332a0f7..8618cd88763547e940525408e2c73b71a3f9731e 100644
--- a/testsample.py
+++ b/testsample.py
@@ -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())