summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIrina Truong <i.chernyavska@gmail.com>2019-01-02 16:15:59 -0800
committerGitHub <noreply@github.com>2019-01-02 16:15:59 -0800
commit0cae7e20361dbee41fb8f79d7ee9c763d17d51e1 (patch)
tree2f5c4054233777bc420d2b9f24dc769f1377ac10 /tests
parent2a1de91292e1996f0fff0407ca147c5894be8042 (diff)
Remove some functions completions (#982)
Remove extension and private functions from completer.
Diffstat (limited to 'tests')
-rw-r--r--tests/parseutils/test_function_metadata.py9
-rw-r--r--tests/test_pgexecute.py4
-rw-r--r--tests/test_smart_completion_multiple_schemata.py20
-rw-r--r--tests/test_smart_completion_public_schema_only.py10
4 files changed, 23 insertions, 20 deletions
diff --git a/tests/parseutils/test_function_metadata.py b/tests/parseutils/test_function_metadata.py
index 1f9c6930..1d0b72b7 100644
--- a/tests/parseutils/test_function_metadata.py
+++ b/tests/parseutils/test_function_metadata.py
@@ -3,13 +3,16 @@ from pgcli.packages.parseutils.meta import FunctionMetadata
def test_function_metadata_eq():
f1 = FunctionMetadata(
- 's', 'f', ['x'], ['integer'], [], 'int', False, False, False, None
+ 's', 'f', ['x'], ['integer'], [
+ ], 'int', False, False, False, False, None
)
f2 = FunctionMetadata(
- 's', 'f', ['x'], ['integer'], [], 'int', False, False, False, None
+ 's', 'f', ['x'], ['integer'], [
+ ], 'int', False, False, False, False, None
)
f3 = FunctionMetadata(
- 's', 'g', ['x'], ['integer'], [], 'int', False, False, False, None
+ 's', 'g', ['x'], ['integer'], [
+ ], 'int', False, False, False, False, None
)
assert f1 == f2
assert f1 != f3
diff --git a/tests/test_pgexecute.py b/tests/test_pgexecute.py
index 559ac5a3..a2340547 100644
--- a/tests/test_pgexecute.py
+++ b/tests/test_pgexecute.py
@@ -13,11 +13,11 @@ from pgcli.main import PGCli
def function_meta_data(
func_name, schema_name='public', arg_names=None, arg_types=None,
arg_modes=None, return_type=None, is_aggregate=False, is_window=False,
- is_set_returning=False, arg_defaults=None
+ is_set_returning=False, is_extension=False, arg_defaults=None
):
return FunctionMetadata(
schema_name, func_name, arg_names, arg_types, arg_modes, return_type,
- is_aggregate, is_window, is_set_returning, arg_defaults
+ is_aggregate, is_window, is_set_returning, is_extension, arg_defaults
)
@dbtest
diff --git a/tests/test_smart_completion_multiple_schemata.py b/tests/test_smart_completion_multiple_schemata.py
index fd92c373..c332cf74 100644
--- a/tests/test_smart_completion_multiple_schemata.py
+++ b/tests/test_smart_completion_multiple_schemata.py
@@ -30,20 +30,20 @@ metadata = {
},
'functions': {
'public': [
- ['func1', [], [], [], '', False, False, False],
- ['func2', [], [], [], '', False, False, False]],
+ ['func1', [], [], [], '', False, False, False, False],
+ ['func2', [], [], [], '', False, False, False, False]],
'custom': [
- ['func3', [], [], [], '', False, False, False],
+ ['func3', [], [], [], '', False, False, False, False],
['set_returning_func', ['x'], ['integer'], ['o'],
- 'integer', False, False, True]],
+ 'integer', False, False, True, False]],
'Custom': [
- ['func4', [], [], [], '', False, False, False]],
+ ['func4', [], [], [], '', False, False, False, False]],
'blog': [
['extract_entry_symbols', ['_entryid', 'symbol'],
- ['integer', 'text'], ['i', 'o'], '', False, False, True],
+ ['integer', 'text'], ['i', 'o'], '', False, False, True, False],
['enter_entry', ['_title', '_text', 'entryid'],
['text', 'text', 'integer'], ['i', 'i', 'o'],
- '', False, False, False]],
+ '', False, False, False, False]],
},
'datatypes': {
'public': ['typ1', 'typ2'],
@@ -579,7 +579,7 @@ def test_all_schema_objects(completer):
result = result_set(completer, text)
assert result >= set(
[table(x) for x in ('orders', '"select"', 'custom.shipments')]
- + [function(x+'()') for x in ('func2', 'custom.func3')]
+ + [function(x + '()') for x in ('func2',)]
)
@@ -589,7 +589,7 @@ def test_all_schema_objects_with_casing(completer):
result = result_set(completer, text)
assert result >= set(
[table(x) for x in ('Orders', '"select"', 'CUSTOM.shipments')]
- + [function(x+'()') for x in ('func2', 'CUSTOM.func3')]
+ + [function(x + '()') for x in ('func2',)]
)
@@ -599,7 +599,7 @@ def test_all_schema_objects_with_aliases(completer):
result = result_set(completer, text)
assert result >= set(
[table(x) for x in ('orders o', '"select" s', 'custom.shipments s')]
- + [function(x) for x in ('func2() f', 'custom.func3() f')]
+ + [function(x) for x in ('func2() f',)]
)
diff --git a/tests/test_smart_completion_public_schema_only.py b/tests/test_smart_completion_public_schema_only.py
index 3ccac9e5..0b8fbcc4 100644
--- a/tests/test_smart_completion_public_schema_only.py
+++ b/tests/test_smart_completion_public_schema_only.py
@@ -17,12 +17,12 @@ metadata = {
'functions': ['function'],
},
'functions': [
- ['custom_fun', [], [], [], '', False, False, False],
- ['_custom_fun', [], [], [], '', False, False, False],
- ['custom_func1', [], [], [], '', False, False, False],
- ['custom_func2', [], [], [], '', False, False, False],
+ ['custom_fun', [], [], [], '', False, False, False, False],
+ ['_custom_fun', [], [], [], '', False, False, False, False],
+ ['custom_func1', [], [], [], '', False, False, False, False],
+ ['custom_func2', [], [], [], '', False, False, False, False],
['set_returning_func', ['x', 'y'], ['integer', 'integer'],
- ['b', 'b'], '', False, False, True]],
+ ['b', 'b'], '', False, False, True, False]],
'datatypes': ['custom_type1', 'custom_type2'],
'foreignkeys': [
('public', 'users', 'id', 'public', 'users', 'parentid'),