MCPcopy
hub / github.com/andialbrecht/sqlparse / test_grouping_identifier_list_subquery

Function test_grouping_identifier_list_subquery

tests/test_grouping.py:210–219  ·  view source on GitHub ↗

identifier lists should still work in subqueries with aliases

()

Source from the content-addressed store, hash-verified

208
209
210def test_grouping_identifier_list_subquery():
211 """identifier lists should still work in subqueries with aliases"""
212 p = sqlparse.parse("select * from ("
213 "select a, b + c as d from table) sub")[0]
214 subquery = p.tokens[-1].tokens[0]
215 idx, iden_list = subquery.token_next_by(i=sql.IdentifierList)
216 assert iden_list is not None
217 # all the identifiers should be within the IdentifierList
218 _, ilist = subquery.token_next_by(i=sql.Identifier, idx=idx)
219 assert ilist is None
220
221
222def test_grouping_identifier_list_case():

Callers

nothing calls this directly

Calls 1

token_next_byMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…