def test_loop_demo(self):
        template = Template("""x|index|reverse_index|first|last|cycle|even|odd
% for x in 'ham':
${x}|${loop.index}|${loop.reverse_index}|${loop.first}|${loop.last}|${loop.cycle('even', 'odd')}|${loop.even}|${loop.odd}
% endfor""")
        expected = [
                "x|index|reverse_index|first|last|cycle|even|odd",
                "h|0|2|True|False|even|True|False",
                "a|1|1|False|False|odd|False|True",
                "m|2|0|False|True|even|True|False"
            ]
        code = template.code
        assert "loop = __M_loop._enter(" in code, "Generated a loop context since "\
                "the loop variable was accessed"
        rendered = template.render()
        print(rendered)
        for line in expected:
            assert line in rendered, "Loop variables give information about "\
                    "the progress of the loop"
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Mako-0.8.1/test/test_loop.py/TestLoop.test_loop_demo/original