summaryrefslogtreecommitdiffstats
path: root/tests/test_smart_completion_public_schema_only.py
diff options
context:
space:
mode:
authorkoljonen <koljonen@outlook.com>2016-05-31 23:42:14 +0200
committerkoljonen <koljonen@outlook.com>2016-05-31 23:45:11 +0200
commite217bac4393b097a0e95fbc190e0aa407e3944e5 (patch)
tree8cfb71550a2b172e8a82b0a927a948f79cb83661 /tests/test_smart_completion_public_schema_only.py
parent017bc3943fbe5685258d88439d29a30a11bd2559 (diff)
Fix issue with 'SELECT Foo.*<cursor> FROM Foo'
In the expansion, we got '"Foo".<col>' when we should have gotten 'Foo.<col>'.
Diffstat (limited to 'tests/test_smart_completion_public_schema_only.py')
-rw-r--r--tests/test_smart_completion_public_schema_only.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/test_smart_completion_public_schema_only.py b/tests/test_smart_completion_public_schema_only.py
index 5bc745f2..9f78c49f 100644
--- a/tests/test_smart_completion_public_schema_only.py
+++ b/tests/test_smart_completion_public_schema_only.py
@@ -610,16 +610,19 @@ def test_wildcard_column_expansion_with_alias_qualifier(completer, complete_even
assert expected == completions
-
-def test_wildcard_column_expansion_with_table_qualifier(completer, complete_event):
- sql = 'SELECT users.* FROM users'
+@pytest.mark.parametrize('text,expected', [
+ ('SELECT users.* FROM users',
+ 'id, users.email, users.first_name, users.last_name'),
+ ('SELECT Users.* FROM Users',
+ 'id, Users.email, Users.first_name, Users.last_name'),
+])
+def test_wildcard_column_expansion_with_table_qualifier(completer, complete_event, text, expected):
pos = len('SELECT users.*')
completions = completer.get_completions(
- Document(text=sql, cursor_position=pos), complete_event)
+ Document(text=text, cursor_position=pos), complete_event)
- col_list = 'id, users.email, users.first_name, users.last_name'
- expected = [Completion(text=col_list, start_position=-1,
+ expected = [Completion(text=expected, start_position=-1,
display='*', display_meta='columns')]
assert expected == completions