1
1
mirror of https://github.com/dbcli/pgcli.git synced 2024-11-09 16:34:32 +03:00

Remove dead code and fix a broken test (all found by Codacy)

This commit is contained in:
koljonen 2016-05-15 19:41:30 +02:00
parent 30727196ed
commit 838d4f6950
No known key found for this signature in database
GPG Key ID: AF0327B5131CD164
8 changed files with 2 additions and 20 deletions

View File

@ -20,7 +20,6 @@ try:
import setproctitle import setproctitle
except ImportError: except ImportError:
setproctitle = None setproctitle = None
import sqlparse
from prompt_toolkit import CommandLineInterface, Application, AbortAction from prompt_toolkit import CommandLineInterface, Application, AbortAction
from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode
from prompt_toolkit.shortcuts import create_prompt_layout, create_eventloop from prompt_toolkit.shortcuts import create_prompt_layout, create_eventloop

View File

@ -1,6 +1,5 @@
import traceback import traceback
import logging import logging
import pprint
import itertools import itertools
import psycopg2 import psycopg2
import psycopg2.extras import psycopg2.extras

View File

@ -4,7 +4,6 @@ from __future__ import print_function
import os import os
import sys import sys
import pexpect
import db_utils as dbutils import db_utils as dbutils
import fixture_utils as fixutils import fixture_utils as fixutils

View File

@ -1,5 +1,4 @@
from pgcli.packages.expanded import expanded_table from pgcli.packages.expanded import expanded_table
import pytest
def test_expanded_table_renders(): def test_expanded_table_renders():
input = [("hello", 123),("world", 456)] input = [("hello", 123),("world", 456)]

View File

@ -1,7 +1,5 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import pytest import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture @pytest.fixture

View File

@ -1,6 +1,5 @@
import os import os
import platform import platform
import stat
import mock import mock
import pytest import pytest

View File

@ -96,11 +96,11 @@ def test_simple_insert_single_table_schema_qualified():
tables = extract_tables('insert into abc.def (id, name) values (1, "def")') tables = extract_tables('insert into abc.def (id, name) values (1, "def")')
assert tables == (('abc', 'def', None, False),) assert tables == (('abc', 'def', None, False),)
def test_simple_update_table(): def test_simple_update_table_no_schema():
tables = extract_tables('update abc set id = 1') tables = extract_tables('update abc set id = 1')
assert tables == ((None, 'abc', None, False),) assert tables == ((None, 'abc', None, False),)
def test_simple_update_table(): def test_simple_update_table_with_schema():
tables = extract_tables('update abc.def set id = 1') tables = extract_tables('update abc.def set id = 1')
assert tables == (('abc', 'def', None, False),) assert tables == (('abc', 'def', None, False),)

View File

@ -499,17 +499,6 @@ def test_join_functions_using_suggests_common_columns(completer, complete_event)
Completion(text='y', start_position=0, display_meta='column')]) Completion(text='y', start_position=0, display_meta='column')])
def test_join_functions_using_suggests_common_columns(completer, complete_event):
text = '''SELECT * FROM set_returning_func() f1
INNER JOIN set_returning_func() f2 USING ('''
pos = len(text)
result = set(completer.get_completions(
Document(text=text, cursor_position=pos), complete_event))
assert set(result) == set([
Completion(text='x', start_position=0, display_meta='column'),
Completion(text='y', start_position=0, display_meta='column')])
def test_join_functions_on_suggests_columns(completer, complete_event): def test_join_functions_on_suggests_columns(completer, complete_event):
text = '''SELECT * FROM set_returning_func() f1 text = '''SELECT * FROM set_returning_func() f1
INNER JOIN set_returning_func() f2 ON f1.''' INNER JOIN set_returning_func() f2 ON f1.'''