コード例 #1
0
ファイル: test_wsgi.py プロジェクト: priya-pp/Tacker
    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
ファイル: test_wsgi.py プロジェクト: priya-pp/Tacker
    def test_dispatch(self):
        """Test ActionDispatcher.dispatch."""
        serializer = wsgi.ActionDispatcher()
        serializer.create = lambda x: x

        self.assertEqual(serializer.dispatch('pants', action='create'),
                         'pants')
コード例 #3
0
ファイル: test_wsgi.py プロジェクト: priya-pp/Tacker
    def test_dispatch_action_None(self):
        """Test ActionDispatcher.dispatch with none action."""
        serializer = wsgi.ActionDispatcher()
        serializer.create = lambda x: x + ' pants'
        serializer.default = lambda x: x + ' trousers'

        self.assertEqual(serializer.dispatch('Two', action=None),
                         'Two trousers')