Example #1
0
def test_decode_stmt():
    assert (
        transform_string('with $qq:\n    body') ==
        "qq._quote_stmt(0,'    body')\n"
    )
    assert (
        transform_string('with $qq:\n    body\nout') ==
        "qq._quote_stmt(0,'    body\\n')\n\nout"
    )
Example #2
0
def test_decode_expr():
    assert transform_string('[$qq|body|]') == "qq._quote_expr(0,'     body')"
Example #3
0
def test_decode_stmt():
    assert (transform_string('with $qq:\n    body') ==
            "qq._quote_stmt(0,'    body')\n")
    assert (transform_string('with $qq:\n    body\nout') ==
            "qq._quote_stmt(0,'    body\\n')\n\nout")
Example #4
0
def test_decode_expr():
    assert transform_string('[$qq|body|]') == "qq._quote_expr(0,'     body')"