MCPcopy
hub / github.com/tornadoweb/tornado / test_if

Method test_if

tornado/test/template_test.py:119–122  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

117 self.assertEqual(template.generate(upper=upper), utf8("FOO \u00c9"))
118
119 def test_if(self):
120 template = Template(utf8("{% if x > 4 %}yes{% else %}no{% end %}"))
121 self.assertEqual(template.generate(x=5), b"yes")
122 self.assertEqual(template.generate(x=3), b"no")
123
124 def test_if_empty_body(self):
125 template = Template(utf8("{% if True %}{% else %}{% end %}"))

Callers

nothing calls this directly

Calls 3

generateMethod · 0.95
TemplateClass · 0.90
utf8Function · 0.90

Tested by

no test coverage detected