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

Function test_identifier_consumes_ordering

tests/test_grouping.py:456–465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

454
455
456def test_identifier_consumes_ordering():
457 # issue89
458 p = sqlparse.parse('select * from foo order by c1 desc, c2, c3')[0]
459 assert isinstance(p.tokens[-1], sql.IdentifierList)
460 ids = list(p.tokens[-1].get_identifiers())
461 assert len(ids) == 3
462 assert ids[0].get_name() == 'c1'
463 assert ids[0].get_ordering() == 'DESC'
464 assert ids[1].get_name() == 'c2'
465 assert ids[1].get_ordering() is None
466
467
468def test_comparison_with_keywords():

Callers

nothing calls this directly

Calls 3

get_identifiersMethod · 0.80
get_nameMethod · 0.80
get_orderingMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…