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

Method test_where

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

Source from the content-addressed store, hash-verified

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)
438 s = 'select * from foo where bar = 1 and baz = 2 or bzz = 3;'
439 assert f(s) == '\n'.join([
440 'select *',
441 'from foo',
442 'where bar = 1',
443 ' and baz = 2',
444 ' or bzz = 3;'])
445
446 s = 'select * from foo where bar = 1 and (baz = 2 or bzz = 3);'
447 assert f(s) == '\n'.join([
448 'select *',
449 'from foo',
450 'where bar = 1',
451 ' and (baz = 2',
452 ' or bzz = 3);'])
453
454 def test_join(self):
455 f = lambda sql: sqlparse.format(sql, reindent=True)

Callers

nothing calls this directly

Calls 1

fFunction · 0.85

Tested by

no test coverage detected