示例#1
0
 def test_comments(self):
     template = "What {{! the }} what?"
     actual = braces.render(template)
     self.assertEqual("What  what?", actual)
示例#2
0
 def test_kwargs(self):
     ret = braces.render("Hi {{thing}}!", thing='world')
     self.assertEqual(ret, "Hi world!")
示例#3
0
 def _assert_rendered(self, expected, template, context):
     actual = braces.render(template, context)
     self.assertEqual(actual, expected)
示例#4
0
 def test_basic(self):
     ret = braces.render("Hi {{thing}}!", { 'thing': 'world' })
     self.assertEqual(ret, "Hi world!")
示例#5
0
 def test():
     actual = braces.render(template, context)
     if actual != expected:
         raise Exception("Benchmark mismatch: \n%s\n*** != ***\n%s" % (expected, actual))