From e217bac4393b097a0e95fbc190e0aa407e3944e5 Mon Sep 17 00:00:00 2001 From: koljonen Date: Tue, 31 May 2016 23:42:14 +0200 Subject: Fix issue with 'SELECT Foo.* FROM Foo' In the expansion, we got '"Foo".' when we should have gotten 'Foo.'. --- tests/test_smart_completion_public_schema_only.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tests/test_smart_completion_public_schema_only.py') 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 -- cgit v1.2.3