Beispiel #1
0
def test_include():
    test_case = """<html><body><!-- highroller: include start --<h1>It works!</h1>!-- highroller: include end -->
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
<!-- --><!-- highroller: include start --<h1>Show me!</h1>!-- highroller: include end -->
<!-- highroller: exclude start -->
dont show me 2
<!-- highroller: exclude end -->
</body></html>"""

    test_response = """<html><body><h1>It works!</h1>
<p>This is the default web page for this server.</p>
<p>The web server software is running but no content has been added, yet.</p>
<!-- --><h1>Show me!</h1>
<!-- highroller: exclude start -->
dont show me 2
<!-- highroller: exclude end -->
</body></html>"""

    hr = Highroller()
    response = hr._run_include(test_case)
    assert test_response == response