Exemple #1
0
    def test_engine_func(self):
        def engine(data, template=None):
            return 'text/plain', data

        render = Engines()
        render['raw'] = engine

        self.assertEqual(render.raw("foo"), ('text/plain', 'foo'))

        del render.raw
Exemple #2
0
 def test_engine_func(self):
     def engine(data, template=None):
         return 'text/plain', data
     
     render = Engines()
     render['raw'] = engine
     
     self.assertEqual(render.raw("foo"), ('text/plain', 'foo'))
     
     del render.raw
Exemple #3
0
    def test_engine_class(self):
        class Engine(object):
            def __call__(self, data, template=None):
                return 'text/plain', data

        render = Engines()
        render['raw'] = Engine

        self.assertEqual(render.raw("foo"), ('text/plain', 'foo'))

        del render.raw
Exemple #4
0
 def test_engine_class(self):
     class Engine(object):
         def __call__(self, data, template=None):
             return 'text/plain', data
     
     render = Engines()
     render['raw'] = Engine
     
     self.assertEqual(render.raw("foo"), ('text/plain', 'foo'))
     
     del render.raw