MCPcopy Create free account
hub / github.com/EasyIME/PIME / test_break_continue

Method test_break_continue

python/python3/tornado/test/template_test.py:146–164  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

144 self.assertEqual(template.generate(), b"foo")
145
146 def test_break_continue(self):
147 template = Template(
148 utf8(
149 """\
150{% for i in range(10) %}
151 {% if i == 2 %}
152 {% continue %}
153 {% end %}
154 {{ i }}
155 {% if i == 6 %}
156 {% break %}
157 {% end %}
158{% end %}"""
159 )
160 )
161 result = template.generate()
162 # remove extraneous whitespace
163 result = b"".join(result.split())
164 self.assertEqual(result, b"013456")
165
166 def test_break_outside_loop(self):
167 try:

Callers

nothing calls this directly

Calls 5

generateMethod · 0.95
TemplateClass · 0.90
utf8Function · 0.90
joinMethod · 0.80
splitMethod · 0.80

Tested by

no test coverage detected