Пример #1
0
 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
Пример #2
0
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
Пример #3
0
    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)
Пример #4
0
def setup():
    Router.clear_routes()
    Router.clear_states()
    Router.load(['salmon_tests.simple_fsm_mod'])
Пример #5
0
def setup_router(handlers):
    Router.clear_routes()
    Router.clear_states()
    Router.HANDLERS.clear()
    Router.load(handlers)
    Router.reload()
Пример #6
0
def cleanup_router():
    Router.clear_routes()
    Router.clear_states()
    Router.HANDLERS.clear()
    utils.settings = None
Пример #7
0
def cleanup_router():
    Router.clear_routes()
    Router.clear_states()
    Router.HANDLERS.clear()
    utils.settings = None
Пример #8
0
def cleanup_router():
    Router.clear_routes()
    Router.clear_states()
    Router.HANDLERS.clear()
Пример #9
0
def setup_router(handlers):
    Router.clear_routes()
    Router.clear_states()
    Router.HANDLERS.clear()
    Router.load(handlers)
Пример #10
0
def cleanup_router():
    Router.clear_routes()
    Router.clear_states()
    Router.HANDLERS.clear()
Пример #11
0
 def tearDown(self):
     Router.clear_routes()
     Router.clear_states()
     Router.HANDLERS.clear()
     utils.settings = None
Пример #12
0
def setup():
    Router.clear_routes()
    Router.clear_states()
    Router.load(['salmon_tests.simple_fsm_mod'])