Example #1
0
def test_simple() -> None:
    yaml_inputs = ["foo:\n  bar"]
    template = "{{foo}}"
    assert render_html(yaml_inputs, template) == "bar"
Example #2
0
def test_inheritance() -> None:
    yaml_inputs = ["foo:\n  bar"]
    template = "{% extends \"base.html\" %}{% block fooblock %}{{foo}}{% endblock %}"
    chdir("./tests")
    assert render_html(yaml_inputs, template) == "base bar"
Example #3
0
def test_reuse() -> None:
    yaml_inputs = ["foo: &alias\n  bar", "hello: *alias"]
    template = "{{foo}} {{hello}}"
    assert render_html(yaml_inputs, template) == "bar bar"
Example #4
0
def test_tags() -> None:
    yaml_inputs = ["foo:\n  _bar_ __baz__"]
    template = "{{foo}}"
    assert render_html(yaml_inputs, template) == "<em>bar</em> <strong>baz</strong>"
Example #5
0
def test_overwrite() -> None:
    yaml_inputs = ["foo:\n  bar", "foo:\n  baz"]
    template = "{{foo}}"
    assert render_html(yaml_inputs, template) == "baz"