diff options
author | Darik Gamble <darik.gamble.spam@gmail.com> | 2015-11-22 16:21:08 -0500 |
---|---|---|
committer | Darik Gamble <darik.gamble.spam@gmail.com> | 2015-11-25 16:17:08 -0500 |
commit | 0f70ccad3124e109c455e9d93bd3f58498e5f72f (patch) | |
tree | 2d4b3cf39ad50ba070dfbe3c48ae774e2c83124f /tests/test_smart_completion_public_schema_only.py | |
parent | 5dde125d9399296ae91eff7267651af7e70b4063 (diff) |
Add a bunch of tests for multiple joins
Diffstat (limited to 'tests/test_smart_completion_public_schema_only.py')
-rw-r--r-- | tests/test_smart_completion_public_schema_only.py | 12 |
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 ') |