diff options
author | darikg <darikg@users.noreply.github.com> | 2016-05-25 19:11:07 -0400 |
---|---|---|
committer | darikg <darikg@users.noreply.github.com> | 2016-05-25 19:11:07 -0400 |
commit | a9c209df7a046846a16930124a865432d7caf2a1 (patch) | |
tree | ce9c57cace1eccb2f45c049dbea690bd5ac481da /tests | |
parent | ab91b83723901ea6b9a52be329f258901f612c6b (diff) | |
parent | 59e3068a07c1ffb3167fcb798c78ea434f6af3c8 (diff) |
Merge pull request #510 from koljonen/fixtablecasingissue2
Fix another problem where table names would not be recognized when nott in lower case
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_smart_completion_multiple_schemata.py | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/tests/test_smart_completion_multiple_schemata.py b/tests/test_smart_completion_multiple_schemata.py index 7232ec93..a8df8ce7 100644 --- a/tests/test_smart_completion_multiple_schemata.py +++ b/tests/test_smart_completion_multiple_schemata.py @@ -332,13 +332,16 @@ def test_suggest_columns_from_aliased_set_returning_function(completer, complete assert set(result) == set([ Completion(text='x', start_position=0, display_meta='column')]) - -def test_wildcard_column_expansion(completer, complete_event): - sql = 'SELECT * FROM custom.set_returning_func()' +@pytest.mark.parametrize('text', [ + 'SELECT * FROM custom.set_returning_func()', + 'SELECT * FROM Custom.set_returning_func()', + 'SELECT * FROM Custom.Set_Returning_Func()' +]) +def test_wildcard_column_expansion_with_function(completer, complete_event, text): pos = len('SELECT *') completions = completer.get_completions( - Document(text=sql, cursor_position=pos), complete_event) + Document(text=text, cursor_position=pos), complete_event) col_list = 'x' expected = [Completion(text=col_list, start_position=-1, @@ -360,6 +363,32 @@ def test_wildcard_column_expansion_with_alias_qualifier(completer, complete_even assert expected == completions +@pytest.mark.parametrize('text', [ + 'INSERT INTO public.orders(*', + 'INSERT INTO public.Orders(*', + 'INSERT INTO public.orders (*', + 'INSERT INTO public.Orders (*', + 'INSERT INTO orders(*', + 'INSERT INTO Orders(*', + 'INSERT INTO orders (*', + 'INSERT INTO Orders (*', + 'INSERT INTO public.orders(*)', + 'INSERT INTO public.Orders(*)', + 'INSERT INTO public.orders (*)', + 'INSERT INTO public.Orders (*)', + 'INSERT INTO orders(*)', + 'INSERT INTO Orders(*)', + 'INSERT INTO orders (*)', + 'INSERT INTO Orders (*)' +]) +def test_wildcard_column_expansion_with_insert(completer, complete_event, text): + pos = text.index('*') + 1 + completions = completer.get_completions( + Document(text=text, cursor_position=pos), complete_event) + + expected = [Completion(text='id, ordered_date, status', start_position=-1, + display='*', display_meta='columns')] + assert expected == completions def test_wildcard_column_expansion_with_table_qualifier(completer, complete_event): sql = 'SELECT "select".* FROM public."select"' |