This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
__author__ = 'RemiZOffAlex'
|
||||
__email__ = 'remizoffalex@mail.ru'
|
||||
|
||||
import unittest
|
||||
|
||||
from router.dispacher import Dispacher
|
||||
|
||||
|
||||
def comparator(params):
|
||||
return 'param' in params
|
||||
|
||||
|
||||
def action(params):
|
||||
return params['param']
|
||||
|
||||
|
||||
class TestDispatcher(unittest.TestCase):
|
||||
def test_dispatcher(self):
|
||||
dispacher = Dispatcher()
|
||||
params ={'param': True}
|
||||
dispatcher.register('name', comparator, action)
|
||||
result = dispatcher(params)
|
||||
self.assertTrue(result)
|
||||
Reference in New Issue
Block a user