diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-09-06 04:17:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-09-06 04:17:09 +0000 |
commit | 76d27bc43d56d7ef3ca0090fb199777888adf7c3 (patch) | |
tree | b6d3d562a0be03d404426bb43aff62174be3dc5e /tests/test_smart_completion_multiple_schemata.py | |
parent | Adding upstream version 3.1.0. (diff) | |
download | pgcli-0a3ece104da9fc141527935ef80d1c5712b8f6e0.tar.xz pgcli-0a3ece104da9fc141527935ef80d1c5712b8f6e0.zip |
Adding upstream version 3.2.0.upstream/3.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_smart_completion_multiple_schemata.py')
-rw-r--r-- | tests/test_smart_completion_multiple_schemata.py | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/test_smart_completion_multiple_schemata.py b/tests/test_smart_completion_multiple_schemata.py index 805b727..5c9c9af 100644 --- a/tests/test_smart_completion_multiple_schemata.py +++ b/tests/test_smart_completion_multiple_schemata.py @@ -193,7 +193,7 @@ def test_suggested_joins(completer, query, tbl): result = get_result(completer, query.format(tbl)) assert completions_to_set(result) == completions_to_set( testdata.schemas_and_from_clause_items() - + [join("custom.shipments ON shipments.user_id = {0}.id".format(tbl))] + + [join(f"custom.shipments ON shipments.user_id = {tbl}.id")] ) @@ -350,6 +350,36 @@ 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", |