summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-14 14:44:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-01-14 14:44:33 +0000
commit2d358ab3d8f978730beb0600b3957ef4ba599bd3 (patch)
treecb8b30d2acb2e34d7a0605f07bd94972d392162d /test
parentAdding upstream version 1.24.1. (diff)
downloadmycli-2d358ab3d8f978730beb0600b3957ef4ba599bd3.tar.xz
mycli-2d358ab3d8f978730beb0600b3957ef4ba599bd3.zip
Adding upstream version 1.24.2.upstream/1.24.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--test/test_completion_engine.py11
-rw-r--r--test/test_completion_refresher.py2
-rw-r--r--test/test_naive_completion.py2
-rw-r--r--test/test_smart_completion_public_schema_only.py4
-rw-r--r--test/test_special_iocommands.py2
5 files changed, 16 insertions, 5 deletions
diff --git a/test/test_completion_engine.py b/test/test_completion_engine.py
index 9e7c608..8b06ed3 100644
--- a/test/test_completion_engine.py
+++ b/test/test_completion_engine.py
@@ -393,6 +393,17 @@ def test_join_using_suggests_common_columns(col_list):
'tables': [(None, 'abc', None), (None, 'def', None)],
'drop_unique': True}]
+@pytest.mark.parametrize('sql', [
+ 'SELECT * FROM abc a JOIN def d ON a.id = d.id JOIN ghi g ON g.',
+ 'SELECT * FROM abc a JOIN def d ON a.id = d.id AND a.id2 = d.id2 JOIN ghi g ON d.id = g.id AND g.',
+])
+def test_two_join_alias_dot_suggests_cols1(sql):
+ suggestions = suggest_type(sql, sql)
+ assert sorted_dicts(suggestions) == sorted_dicts([
+ {'type': 'column', 'tables': [(None, 'ghi', 'g')]},
+ {'type': 'table', 'schema': 'g'},
+ {'type': 'view', 'schema': 'g'},
+ {'type': 'function', 'schema': 'g'}])
def test_2_statements_2nd_current():
suggestions = suggest_type('select * from a; select * from ',
diff --git a/test/test_completion_refresher.py b/test/test_completion_refresher.py
index 1ed6377..cdc2fb5 100644
--- a/test/test_completion_refresher.py
+++ b/test/test_completion_refresher.py
@@ -1,6 +1,6 @@
import time
import pytest
-from mock import Mock, patch
+from unittest.mock import Mock, patch
@pytest.fixture
diff --git a/test/test_naive_completion.py b/test/test_naive_completion.py
index 14c1bf5..32b2abd 100644
--- a/test/test_naive_completion.py
+++ b/test/test_naive_completion.py
@@ -11,7 +11,7 @@ def completer():
@pytest.fixture
def complete_event():
- from mock import Mock
+ from unittest.mock import Mock
return Mock()
diff --git a/test/test_smart_completion_public_schema_only.py b/test/test_smart_completion_public_schema_only.py
index b66c696..e7d460a 100644
--- a/test/test_smart_completion_public_schema_only.py
+++ b/test/test_smart_completion_public_schema_only.py
@@ -1,5 +1,5 @@
import pytest
-from mock import patch
+from unittest.mock import patch
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
import mycli.packages.special.main as special
@@ -35,7 +35,7 @@ def completer():
@pytest.fixture
def complete_event():
- from mock import Mock
+ from unittest.mock import Mock
return Mock()
diff --git a/test/test_special_iocommands.py b/test/test_special_iocommands.py
index 73bfbab..8b6be33 100644
--- a/test/test_special_iocommands.py
+++ b/test/test_special_iocommands.py
@@ -2,7 +2,7 @@ import os
import stat
import tempfile
from time import time
-from mock import patch
+from unittest.mock import patch
import pytest
from pymysql import ProgrammingError