From a180b212c6fc06af7642c3eedd7f438dfb57ed79 Mon Sep 17 00:00:00 2001 From: Stuart Gathman Date: Mon, 11 Mar 2013 23:52:21 +0000 Subject: [PATCH] Call negotiate from test mixin so that the noreply exception works. --- Milter/test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Milter/test.py b/Milter/test.py index bed8097..92a5387 100644 --- a/Milter/test.py +++ b/Milter/test.py @@ -5,14 +5,16 @@ import rfc822 import StringIO import Milter +Milter.NOREPLY = Milter.CONTINUE + ## Test mixin for unit testing milter applications. # This mixin overrides many Milter.MilterBase methods # with stub versions that simply record what was done. # @since 0.9.8 class TestBase(object): - _protocol = 0 def __init__(self,logfile='test/milter.log'): + self._protocol = 0 self.logfp = open(logfile,"a") ## List of recipients deleted self._delrcpt = [] @@ -178,6 +180,8 @@ class TestBase(object): def connect(self,host='localhost',helo='spamrelay',ip='1.2.3.4'): self._body = None self._bodyreplaced = False + opts = [ Milter.CURR_ACTS,~0,0,0 ] + rc = self.negotiate(opts) rc = super(TestBase,self).connect(host,1,(ip,1234)) if rc != Milter.CONTINUE: self.close() @@ -186,4 +190,3 @@ class TestBase(object): if rc != Milter.CONTINUE: self.close() return rc -