Пример #1
0
 def test_dispatch_default(self):
     serializer = wsgi.ActionDispatcher()
     serializer.create = lambda x: x + ' pants'
     serializer.default = lambda x: x + ' trousers'
     self.assertEqual(serializer.dispatch('Two', action='update'),
                      'Two trousers')
Пример #2
0
 def test_dispatch(self):
     serializer = wsgi.ActionDispatcher()
     serializer.create = lambda x: x
     self.assertEqual(serializer.dispatch('pants', action='create'),
                      'pants')