def test_hyphen_filenames(self): from pyramid.mako_templating import renderer_factory info = DummyRendererInfo({ 'name':'app:moon-and-world.mak', 'package':None, 'registry':self.config.registry, 'settings':{}, 'type': '' }) result = renderer_factory(info) self.assertEqual(result.path, 'app:moon-and-world.mak')
def test_space_dot_name_def(self): from pyramid.mako_templating import renderer_factory info = DummyRendererInfo({ 'name':'hello .world#comp.mako', 'package':None, 'registry':self.config.registry, 'settings':{}, }) result = renderer_factory(info) self.assertEqual(result.path, 'hello .world.mako') self.assertEqual(result.defname, 'comp')
def test_hyphen_filenames(self): from pyramid.mako_templating import renderer_factory info = DummyRendererInfo({ 'name': 'app:moon-and-world.mak', 'package': None, 'registry': self.config.registry, 'settings': {}, 'type': '' }) result = renderer_factory(info) self.assertEqual(result.path, 'app:moon-and-world.mak')
def test_space_dot_name_def(self): from pyramid.mako_templating import renderer_factory info = DummyRendererInfo({ 'name': 'hello .world#comp.mako', 'package': None, 'registry': self.config.registry, 'settings': {}, }) result = renderer_factory(info) self.assertEqual(result.path, 'hello .world.mako') self.assertEqual(result.defname, 'comp')
def _callFUT(self, info): from pyramid.mako_templating import renderer_factory return renderer_factory(info)
def __init__(self, info): info.settings['mako.preprocessor'] = preprocessor self.makoRenderer = mako_templating.renderer_factory(info)