def macromilterSUT(request): macromilter.LOG_DIR = 'test_output/' macromilter.MATCHED_FILE_LOG_DIR = 'test_output/matched_files/' macromilter.initialize_async_process_queues(20) macromilter.cleanup_queues() Milter.factory = macromilter.MacroMilter flags = Milter.CHGBODY + Milter.CHGHDRS + Milter.ADDHDRS flags += Milter.ADDRCPT flags += Milter.DELRCPT Milter.set_flags(flags) Milter.factory._ctx = TestBase() sut = macromilter.MacroMilter() sut.messageToParse = StringIO.StringIO() def tear_down(): # clear queues macromilter.cleanup_queues() macromilter.WhiteList = () request.addfinalizer(tear_down) return sut
def tear_down(): # clear queues macromilter.cleanup_queues() macromilter.WhiteList = ()