MCPcopy
hub / github.com/pallets/jinja / visit_Const

Method visit_Const

tests/test_api.py:403–408  ·  tests/test_api.py::TestLowLevel.CustomCodeGenerator.visit_Const
(self, node, frame=None)

Source from the content-addressed store, hash-verified

401 def test_custom_code_generator(self):
402 class CustomCodeGenerator(CodeGenerator):
403 def visit_Const(self, node, frame=None):
404 class="cm"># This method is pure nonsense, but works fine for testing...
405 if node.value == class="st">"foo":
406 self.write(repr(class="st">"bar"))
407 else:
408 super().visit_Const(node, frame)
409
410 class CustomEnvironment(Environment):
411 code_generator_class = CustomCodeGenerator

Callers

nothing calls this directly

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected