コード例 #1
0
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!")
コード例 #2
0
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!")
コード例 #3
0
 def setUp(self):
   self._tm = DictTemplateManager(self._TEMPLATES)
コード例 #4
0
 def setUp(self):
   self._tm = DictTemplateManager(self._TEMPLATES)