(self)
| 233 | |
| 234 | class TestTemplate(unittest.TestCase): |
| 235 | def test_regular_templates(self): |
| 236 | s = Template('$who likes to eat a bag of $what worth $$100') |
| 237 | self.assertEqual(s.substitute(dict(who='tim', what='ham')), |
| 238 | 'tim likes to eat a bag of ham worth $100') |
| 239 | self.assertRaises(KeyError, s.substitute, dict(who='tim')) |
| 240 | self.assertRaises(TypeError, Template.substitute) |
| 241 | |
| 242 | def test_regular_templates_with_braces(self): |
| 243 | s = Template('$who likes ${what} for ${meal}') |
nothing calls this directly
no test coverage detected