summaryrefslogtreecommitdiffstats
path: root/tests/test_smart_completion_public_schema_only.py
diff options
context:
space:
mode:
authorDarik Gamble <darik.gamble.spam@gmail.com>2015-11-26 14:17:13 -0500
committerDarik Gamble <darik.gamble.spam@gmail.com>2015-11-26 14:17:47 -0500
commit90651ca7fe04322e52c3fe27e7d2ec4abeec11ae (patch)
tree7a684f02d7d4d748f11e419473f5210f063c825a /tests/test_smart_completion_public_schema_only.py
parent29d47ebf343547f1c0f0c7f4850c4113409e2844 (diff)
Really sort keywords after everything else
Diffstat (limited to 'tests/test_smart_completion_public_schema_only.py')
-rw-r--r--tests/test_smart_completion_public_schema_only.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_smart_completion_public_schema_only.py b/tests/test_smart_completion_public_schema_only.py
index b936cb96..9b400ebd 100644
--- a/tests/test_smart_completion_public_schema_only.py
+++ b/tests/test_smart_completion_public_schema_only.py
@@ -525,3 +525,16 @@ def test_learn_table_names(completer, complete_event):
orders = Completion(text='orders', start_position=0, display_meta='table')
assert completions.index(users) < completions.index(orders)
+
+
+def test_columns_before_keywords(completer, complete_event):
+ sql = 'SELECT * FROM orders WHERE s'
+ completions = completer.get_completions(
+ Document(text=sql, cursor_position=len(sql)), complete_event)
+
+ column = Completion(text='status', start_position=-1, display_meta='column')
+ keyword = Completion(text='SELECT', start_position=-1, display_meta='keyword')
+
+ assert completions.index(column) < completions.index(keyword)
+
+