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

Function test_sqlite_identifiers

tests/test_parse.py:243–253  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

241
242
243def test_sqlite_identifiers():
244 # Make sure we still parse sqlite style escapes
245 p = sqlparse.parse('[col1],[col2]')[0].tokens
246 id_names = [id_.get_name() for id_ in p[0].get_identifiers()]
247 assert len(p) == 1
248 assert isinstance(p[0], sql.IdentifierList)
249 assert id_names == ['[col1]', '[col2]']
250
251 p = sqlparse.parse('[col1]+[col2]')[0]
252 types = [tok.ttype for tok in p.flatten()]
253 assert types == [T.Name, T.Operator, T.Name]
254
255
256def test_simple_1d_array_index():

Callers

nothing calls this directly

Calls 3

get_nameMethod · 0.80
get_identifiersMethod · 0.80
flattenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…