test_parse.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:codenn 作者: sriniiyer 项目源码 文件源码
def test_sqlite_identifiers():
    # Make sure we still parse sqlite style escapes
    p = sqlparse.parse('[col1],[col2]')[0].tokens
    assert (len(p) == 1
            and isinstance(p[0], sqlparse.sql.IdentifierList)
            and [id.get_name() for id in p[0].get_identifiers()]
                    == ['[col1]', '[col2]'])

    p = sqlparse.parse('[col1]+[col2]')[0]
    types = [tok.ttype for tok in p.flatten()]
    assert types == [T.Name, T.Operator, T.Name]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号