def tearDown(self): Router.clear_routes() Router.clear_states() for key in Router.HANDLERS.keys(): del sys.modules[key] Router.HANDLERS.clear() utils.settings = None
def test_Router_undeliverable_queue(): Router.clear_routes() Router.clear_states() Router.UNDELIVERABLE_QUEUE = Mock() msg = MailRequest('fakepeer', 'from@localhost', 'to@localhost', "Nothing") Router.deliver(msg) assert Router.UNDELIVERABLE_QUEUE.push.called
def test_Router_undeliverable_queue(self): Router.clear_routes() Router.clear_states() Router.UNDELIVERABLE_QUEUE = Mock() msg = MailRequest('fakepeer', 'from@localhost', 'to@localhost', "Nothing") Router.deliver(msg) self.assertEqual(Router.UNDELIVERABLE_QUEUE.push.call_count, 1)
def setup(): Router.clear_routes() Router.clear_states() Router.load(['salmon_tests.simple_fsm_mod'])
def setup_router(handlers): Router.clear_routes() Router.clear_states() Router.HANDLERS.clear() Router.load(handlers) Router.reload()
def cleanup_router(): Router.clear_routes() Router.clear_states() Router.HANDLERS.clear() utils.settings = None
def cleanup_router(): Router.clear_routes() Router.clear_states() Router.HANDLERS.clear()
def setup_router(handlers): Router.clear_routes() Router.clear_states() Router.HANDLERS.clear() Router.load(handlers)
def tearDown(self): Router.clear_routes() Router.clear_states() Router.HANDLERS.clear() utils.settings = None