MCPcopy Create free account
hub / github.com/andialbrecht/sqlparse / test_parenthesis

Method test_parenthesis

tests/test_format.py:422–434  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

420 'and bar = 3'])
421
422 def test_parenthesis(self):
423 f = lambda sql: sqlparse.format(sql, reindent=True)
424 s = 'select count(*) from (select * from foo);'
425 assert f(s) == '\n'.join([
426 'select count(*)',
427 'from',
428 ' (select *',
429 ' from foo);'])
430 assert f("select f(1)") == 'select f(1)'
431 assert f("select f( 1 )") == 'select f(1)'
432 assert f("select f(\n\n\n1\n\n\n)") == 'select f(1)'
433 assert f("select f(\n\n\n 1 \n\n\n)") == 'select f(1)'
434 assert f("select f(\n\n\n 1 \n\n\n)") == 'select f(1)'
435
436 def test_where(self):
437 f = lambda sql: sqlparse.format(sql, reindent=True)

Callers

nothing calls this directly

Calls 1

fFunction · 0.85

Tested by

no test coverage detected