class DictTemplateManagerTest(unittest.TestCase): _TEMPLATES = {'foo': 'foo this {{ arg }}.', 'bar': "it's a {{ is }}, not a {{ is_not }}!"} def setUp(self): self._tm = DictTemplateManager(self._TEMPLATES) def test_render(self): self.assertEqual(self._tm.render('foo', {'arg': 'test'}), 'foo this test.') self.assertEqual(self._tm.render('bar', {'is': 'bar', 'is_not': 'baz'}), "it's a bar, not a baz!")
def setUp(self): self._tm = DictTemplateManager(self._TEMPLATES)