summaryrefslogtreecommitdiffstats
path: root/tests/test_smart_completion_public_schema_only.py
diff options
context:
space:
mode:
authorkoljonen <koljonen@outlook.com>2016-06-18 16:15:38 +0200
committerkoljonen <koljonen@outlook.com>2016-06-18 21:23:12 +0200
commitd40bae021e0787dabc2b97a8f53b614396020261 (patch)
tree9b4355ec372c0fbe2753b5bddae609928ea72d01 /tests/test_smart_completion_public_schema_only.py
parent42cf384ede0d6114311c3145082a8aa529e26c03 (diff)
In completion tests, get tables from metadata instead of manually listing them
Diffstat (limited to 'tests/test_smart_completion_public_schema_only.py')
-rw-r--r--tests/test_smart_completion_public_schema_only.py32
1 files changed, 6 insertions, 26 deletions
diff --git a/tests/test_smart_completion_public_schema_only.py b/tests/test_smart_completion_public_schema_only.py
index 57f138dd..c8bba0d8 100644
--- a/tests/test_smart_completion_public_schema_only.py
+++ b/tests/test_smart_completion_public_schema_only.py
@@ -67,11 +67,7 @@ def test_schema_or_visible_table_completion(completer, complete_event):
position = len(text)
result = completer.get_completions(
Document(text=text, cursor_position=position), complete_event)
- assert set(result) == set(testdata.schemas() + [
- table('users'),
- table('"Users"'),
- table('"select"'),
- table('orders'),
+ assert set(result) == set(testdata.schemas() + testdata.tables() + [
view('user_emails'),
function('custom_func1'),
function('custom_func2'),
@@ -377,14 +373,10 @@ def test_suggested_joins(completer, complete_event, text):
result = set(completer.get_completions(
Document(text=text, cursor_position=position),
complete_event))
- assert set(result) == set(testdata.schemas() + [
+ assert set(result) == set(testdata.schemas() + testdata.tables() + [
join('"Users" ON "Users".userid = users.id'),
join('users users2 ON users2.id = users.parentid'),
join('users users2 ON users2.parentid = users.id'),
- table('"Users"'),
- table('"select"'),
- table('orders'),
- table('users'),
view('user_emails'),
function('custom_func2'),
function('set_returning_func'),
@@ -402,12 +394,8 @@ def test_suggested_joins_quoted_schema_qualified_table(completer, complete_event
result = set(completer.get_completions(
Document(text=text, cursor_position=position),
complete_event))
- assert set(result) == set(testdata.schemas() + [
+ assert set(result) == set(testdata.schemas() + testdata.tables() + [
join('public.users ON users.id = "Users".userid'),
- table('"Users"'),
- table('"select"'),
- table('orders'),
- table('users'),
view('user_emails'),
function('custom_func2'),
function('set_returning_func'),
@@ -520,11 +508,7 @@ def test_table_names_after_from(completer, complete_event, text):
result = completer.get_completions(
Document(text=text, cursor_position=position),
complete_event)
- assert set(result) == set(testdata.schemas() + [
- table('users'),
- table('"Users"'),
- table('orders'),
- table('"select"'),
+ assert set(result) == set(testdata.schemas() + testdata.tables() + [
view('user_emails'),
function('custom_func1'),
function('custom_func2'),
@@ -581,12 +565,8 @@ def test_suggest_datatype(text, completer, complete_event):
pos = len(text)
result = completer.get_completions(
Document(text=text, cursor_position=pos), complete_event)
- assert set(result) == set(testdata.schemas() + testdata.datatypes() + [
- table('users'),
- table('"Users"'),
- table('orders'),
- table('"select"')] +
- list(testdata.builtin_datatypes()))
+ assert set(result) == set(testdata.schemas() + testdata.datatypes() +
+ testdata.tables() + list(testdata.builtin_datatypes()))
def test_suggest_columns_from_escaped_table_alias(completer, complete_event):