test_grouping.py 文件源码

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

项目:codenn 作者: sriniiyer 项目源码 文件源码
def test_identifier_consumes_ordering():  # issue89
    p = sqlparse.parse('select * from foo order by c1 desc, c2, c3')[0]
    assert isinstance(p.tokens[-1], sql.IdentifierList)
    ids = list(p.tokens[-1].get_identifiers())
    assert len(ids) == 3
    assert ids[0].get_name() == 'c1'
    assert ids[0].get_ordering() == 'DESC'
    assert ids[1].get_name() == 'c2'
    assert ids[1].get_ordering() is None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号