diff options
author | koljonen <koljonen@outlook.com> | 2016-06-18 16:21:29 +0200 |
---|---|---|
committer | koljonen <koljonen@outlook.com> | 2016-06-18 21:24:00 +0200 |
commit | a79e1240255e116071df5d0aaf1017604577a8ee (patch) | |
tree | dd376e208ff9a0033ced6f20fa7a9c0ca19adcca /tests/test_smart_completion_public_schema_only.py | |
parent | d40bae021e0787dabc2b97a8f53b614396020261 (diff) |
In completion tests, get views 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.py | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/test_smart_completion_public_schema_only.py b/tests/test_smart_completion_public_schema_only.py index c8bba0d8..580f567b 100644 --- a/tests/test_smart_completion_public_schema_only.py +++ b/tests/test_smart_completion_public_schema_only.py @@ -2,7 +2,6 @@ from __future__ import unicode_literals import pytest from metadata import (MetaData, alias, name_join, fk_join, join, keyword, table, - view, function, column, wildcard_expansion) @@ -67,8 +66,8 @@ 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() + testdata.tables() + [ - view('user_emails'), + assert set(result) == set(testdata.schemas() + + testdata.views() + testdata.tables() + [ function('custom_func1'), function('custom_func2'), function('set_returning_func')]) @@ -373,11 +372,11 @@ 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() + testdata.tables() + [ + assert set(result) == set(testdata.schemas() + testdata.tables() + + testdata.views() + [ join('"Users" ON "Users".userid = users.id'), join('users users2 ON users2.id = users.parentid'), join('users users2 ON users2.parentid = users.id'), - view('user_emails'), function('custom_func2'), function('set_returning_func'), function('custom_func1')]) @@ -394,9 +393,9 @@ 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() + testdata.tables() + [ + assert set(result) == set(testdata.schemas() + testdata.tables() + + testdata.views() + [ join('public.users ON users.id = "Users".userid'), - view('user_emails'), function('custom_func2'), function('set_returning_func'), function('custom_func1')]) @@ -508,8 +507,8 @@ 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() + testdata.tables() + [ - view('user_emails'), + assert set(result) == set(testdata.schemas() + testdata.tables() + + testdata.views() + [ function('custom_func1'), function('custom_func2'), function('set_returning_func') |