Exemple #1
0
def test_find_prev_keyword_open_parens(sql):
    kw, _ = find_prev_keyword(sql)
    assert kw.value == '('
Exemple #2
0
def test_find_prev_keyword_where(sql):
    kw, stripped = find_prev_keyword(sql)
    assert kw.value == 'where' and stripped == 'select * from foo where'
Exemple #3
0
def test_find_prev_keyword_using():
    q = 'select * from tbl1 inner join tbl2 using (col1, '
    kw, q2 = find_prev_keyword(q)
    assert kw.value == '(' and q2 == 'select * from tbl1 inner join tbl2 using ('
Exemple #4
0
def test_find_prev_keyword_open_parens(sql):
    kw, _ = find_prev_keyword(sql)
    assert kw.value == '('
Exemple #5
0
def test_find_prev_keyword_where(sql):
    kw, stripped = find_prev_keyword(sql)
    assert kw.value == 'where' and stripped == 'select * from foo where'
Exemple #6
0
def test_find_prev_keyword_using():
    q = 'select * from tbl1 inner join tbl2 using (col1, '
    kw, q2 = find_prev_keyword(q)
    assert kw.value == '(' and q2 == 'select * from tbl1 inner join tbl2 using ('