Beispiel #1
0
 def test_dispatch(self, dispatcher):
     request = 'test'
     dispatcher.__iadd__ = Mock()
     plugin = Mock()
     builtin = Builtin(plugin)
     result = builtin.dispatch(request)
     builtin.dispatcher.dispatch.assert_called_once_with(request)
     self.assertEqual(result, builtin.dispatcher.dispatch.return_value)
Beispiel #2
0
 def test_dispatch(self, dispatcher):
     request = 'test'
     dispatcher.__iadd__ = Mock()
     plugin = Mock()
     builtin = Builtin(plugin)
     result = builtin.dispatch(request)
     builtin.dispatcher.dispatch.assert_called_once_with(request)
     self.assertEqual(result, builtin.dispatcher.dispatch.return_value)
Beispiel #3
0
 def test_dispatch(self):
     request = Document(routing=['A', 'B'],
                        request={
                            'classname': 'Admin',
                            'method': 'hello',
                            'args': [],
                            'keywords': {}
                        })
     plugin = Mock()
     builtin = Builtin(plugin)
     result = builtin.dispatch(request)
     self.assertEqual(result.retval, Admin().hello())
Beispiel #4
0
 def test_dispatch(self):
     request = Document(
         routing=['A', 'B'],
         request={
             'classname': 'Admin',
             'method': 'hello',
             'args': [],
             'keywords': {}
         })
     plugin = Mock()
     builtin = Builtin(plugin)
     result = builtin.dispatch(request)
     self.assertEqual(result.retval, Admin().hello())