示例#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"
    )
示例#2
0
def test_decode_expr():
    assert transform_string('[$qq|body|]') == "qq._quote_expr(0,'     body')"
示例#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")
示例#4
0
def test_decode_expr():
    assert transform_string('[$qq|body|]') == "qq._quote_expr(0,'     body')"