diff options
author | Amjith Ramanujam <amjith@netflix.com> | 2021-05-07 12:36:40 -0700 |
---|---|---|
committer | Amjith Ramanujam <amjith@netflix.com> | 2021-05-07 12:36:40 -0700 |
commit | c196c28e781b6abd9ff2359109528c883436870d (patch) | |
tree | 1ae44db98f8ea1b3035cdec4b994c7693dd9ce08 | |
parent | 7304cf37089ba07132b58815444fb4526d20bc26 (diff) |
Add tests for search_path function completion.
-rw-r--r-- | tests/test_smart_completion_multiple_schemata.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_smart_completion_multiple_schemata.py b/tests/test_smart_completion_multiple_schemata.py index 74768d39..031e0301 100644 --- a/tests/test_smart_completion_multiple_schemata.py +++ b/tests/test_smart_completion_multiple_schemata.py @@ -350,6 +350,32 @@ def test_schema_qualified_function_name(completer): ) +@parametrize("completer", completers(filtr=True, casing=False, aliasing=False)) +def test_schema_qualified_function_name_after_from(completer): + text = "SELECT * FROM custom.set_r" + result = get_result(completer, text) + assert completions_to_set(result) == completions_to_set( + [function("set_returning_func()", -len("func")),] + ) + + +@parametrize("completer", completers(filtr=True, casing=False, aliasing=False)) +def test_unqualified_function_name_not_returned(completer): + text = "SELECT * FROM set_r" + result = get_result(completer, text) + assert completions_to_set(result) == completions_to_set([]) + + +@parametrize("completer", completers(filtr=True, casing=False, aliasing=False)) +def test_unqualified_function_name_in_search_path(completer): + completer.search_path = ["public", "custom"] + text = "SELECT * FROM set_r" + result = get_result(completer, text) + assert completions_to_set(result) == completions_to_set( + [function("set_returning_func()", -len("func")),] + ) + + @parametrize("completer", completers(filtr=True, casing=False)) @parametrize( "text", |