Beispiel #1
0
def test_without_sql_comment_with_arg_and_leading_comment():

    line = "--file moo.txt --persist --comment, not arg"
    expected = "--file moo.txt --persist"
    assert without_sql_comment(parser=parser_stub, line=line) == expected
Beispiel #2
0
def test_without_sql_persist():

    line = "--persist my_table --uff da"
    expected = "--persist my_table"
    assert without_sql_comment(parser=parser_stub, line=line) == expected
Beispiel #3
0
def test_without_sql_comment_dashes_in_string():

    line = "SELECT '--very --confusing' FROM author -- uff da"
    expected = "SELECT '--very --confusing' FROM author"
    assert without_sql_comment(parser=parser_stub, line=line) == expected
Beispiel #4
0
def test_without_sql_comment_unspaced_comment():

    line = "SELECT * FROM author --uff da"
    expected = "SELECT * FROM author"
    assert without_sql_comment(parser=parser_stub, line=line) == expected
Beispiel #5
0
def test_without_sql_comment_with_arg_and_comment():

    line = "--file moo.txt --persist SELECT * FROM author -- uff da"
    expected = "--file moo.txt --persist SELECT * FROM author"
    assert without_sql_comment(parser=parser_stub, line=line) == expected
Beispiel #6
0
def test_without_sql_comment_with_arg():

    line = "--file moo.txt --persist SELECT * FROM author"
    assert without_sql_comment(parser=parser_stub, line=line) == line
Beispiel #7
0
def test_without_sql_comment_plain():

    line = "SELECT * FROM author"
    assert without_sql_comment(parser=parser_stub, line=line) == line