summaryrefslogtreecommitdiffstats
path: root/tests/test_smart_completion_public_schema_only.py
diff options
context:
space:
mode:
authorAmjith Ramanujam <amjith.r@gmail.com>2015-11-25 19:03:50 -0800
committerAmjith Ramanujam <amjith.r@gmail.com>2015-11-25 19:03:50 -0800
commit29d47ebf343547f1c0f0c7f4850c4113409e2844 (patch)
treefa15d87a3fb4af437325959d55a0f50887fc4c91 /tests/test_smart_completion_public_schema_only.py
parent5dde125d9399296ae91eff7267651af7e70b4063 (diff)
parent2b3e25c00843979c9458a4005e1b16e4f13c1f2b (diff)
Merge pull request #423 from dbcli/darikg/fix-multiple-joins
Fix suggestions in multi-way joins
Diffstat (limited to 'tests/test_smart_completion_public_schema_only.py')
-rw-r--r--tests/test_smart_completion_public_schema_only.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_smart_completion_public_schema_only.py b/tests/test_smart_completion_public_schema_only.py
index 409dabe2..b936cb96 100644
--- a/tests/test_smart_completion_public_schema_only.py
+++ b/tests/test_smart_completion_public_schema_only.py
@@ -292,6 +292,18 @@ def test_suggested_multiple_column_names_with_dot(completer, complete_event):
Completion(text='first_name', start_position=0, display_meta='column'),
Completion(text='last_name', start_position=0, display_meta='column')])
+
+def test_suggest_columns_after_three_way_join(completer, complete_event):
+ text = '''SELECT * FROM users u1
+ INNER JOIN users u2 ON u1.id = u2.id
+ INNER JOIN users u3 ON u2.id = u3.'''
+ position = len(text)
+ result = completer.get_completions(
+ Document(text=text, cursor_position=position), complete_event)
+ assert (Completion(text='id', start_position=0, display_meta='column') in
+ set(result))
+
+
def test_suggested_aliases_after_on(completer, complete_event):
text = 'SELECT u.name, o.id FROM users u JOIN orders o ON '
position = len('SELECT u.name, o.id FROM users u JOIN orders o ON ')