summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2015-07-26 11:20:49 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2015-07-26 11:20:49 +0200
commitfb6b59dece40a608a1c6cf741a4ac6ee88d85d2f (patch)
tree2d013f2e9d2de4fffab927ca03e33dee0ee609c9 /tests
parent8b5a957f4dad82fda0dc174538fdaf0860a9256a (diff)
downloadsqlparse-fb6b59dece40a608a1c6cf741a4ac6ee88d85d2f.tar.gz
Ignore comments at beginning of statement when calling Statement.get_type (fixes #186).
Diffstat (limited to 'tests')
-rw-r--r--tests/test_regressions.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_regressions.py b/tests/test_regressions.py
index 6da94dc..ea8cd56 100644
--- a/tests/test_regressions.py
+++ b/tests/test_regressions.py
@@ -255,3 +255,9 @@ END;
SELECT * FROM a.b;"""
splitted = sqlparse.split(sql)
assert len(splitted) == 2
+
+
+def test_issue186_get_type():
+ sql = "-- comment\ninsert into foo"
+ p = sqlparse.parse(sql)[0]
+ assert p.get_type() == 'INSERT'