Files
router/tests/test_dispatcher.py
T
2026-04-24 22:16:36 +03:00

26 lines
544 B
Python

__author__ = 'RemiZOffAlex'
__email__ = 'remizoffalex@mail.ru'
import unittest
from router.dispatcher import Dispatcher
def comparator(params):
return 'param' in params
def action(params):
return params['param']
class TestDispatcher(unittest.TestCase):
def test_dispatcher(self):
dispatcher = Dispatcher()
params ={'param': True}
dispatcher.register('name', comparator, action)
method = dispatcher(params)
print(method)
result = method(params)
self.assertTrue(result)