diff options
| author | Andrew Tipton <andrew.tipton@compareglobalgroup.com> | 2016-03-02 18:20:12 +0800 |
|---|---|---|
| committer | Andrew Tipton <andrew.tipton@compareglobalgroup.com> | 2016-03-02 18:20:12 +0800 |
| commit | d8e8f30137a06f3e1b92993c2ec69f000a76e9ec (patch) | |
| tree | 84c669bfdba08e5100eec718b3b4493f697b0925 /tests | |
| parent | 56e72ace0e6dcc7b4faac9fe9a3de29371d07932 (diff) | |
| download | sqlparse-d8e8f30137a06f3e1b92993c2ec69f000a76e9ec.tar.gz | |
Add failing test for issue #227.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_regressions.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_regressions.py b/tests/test_regressions.py index ca7dd5b..acadeff 100644 --- a/tests/test_regressions.py +++ b/tests/test_regressions.py @@ -291,3 +291,10 @@ def test_issue212_py2unicode(): def test_issue213_leadingws(): sql = " select * from foo" assert sqlparse.format(sql, strip_whitespace=True) == "select * from foo" + + +def test_issue227_gettype_cte(): + select_stmt = sqlparse.parse('SELECT 1, 2, 3 FROM foo;')[0] + assert select_stmt.get_type() == 'SELECT' + with_stmt = sqlparse.parse('WITH foo AS (SELECT 1, 2, 3) SELECT * FROM foo;')[0] + assert with_stmt.get_type() == 'SELECT' |
