MCPcopy Index your code
hub / github.com/andialbrecht/sqlparse / test_grouping_function

Function test_grouping_function

tests/test_grouping.py:382–395  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

380
381
382def test_grouping_function():
383 p = sqlparse.parse('foo()')[0]
384 assert isinstance(p.tokens[0], sql.Function)
385 p = sqlparse.parse('foo(null, bar)')[0]
386 assert isinstance(p.tokens[0], sql.Function)
387 assert len(list(p.tokens[0].get_parameters())) == 2
388 p = sqlparse.parse('foo(5) over win1')[0]
389 assert isinstance(p.tokens[0], sql.Function)
390 assert len(list(p.tokens[0].get_parameters())) == 1
391 assert isinstance(p.tokens[0].get_window(), sql.Identifier)
392 p = sqlparse.parse('foo(5) over (PARTITION BY c1)')[0]
393 assert isinstance(p.tokens[0], sql.Function)
394 assert len(list(p.tokens[0].get_parameters())) == 1
395 assert isinstance(p.tokens[0].get_window(), sql.Parenthesis)
396
397
398def test_grouping_function_not_in():

Callers

nothing calls this directly

Calls 2

get_parametersMethod · 0.80
get_windowMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…