PEP-8 fixes.

This commit is contained in:
Dave Page 2019-03-28 14:20:52 -04:00
parent 97919d091a
commit 4d45a3cb24
4 changed files with 23 additions and 21 deletions

View File

@ -229,7 +229,8 @@ class SequenceView(PGChildNodeView):
for row in rset['rows']:
if not self.blueprint.show_system_objects:
system_seq = self._get_dependency(row['oid'], show_system_objects=True)
system_seq = self._get_dependency(row['oid'],
show_system_objects=True)
seq = filter(lambda dep: dep['type'] == 'column', system_seq)
if type(seq) is not list:
seq = list(seq)
@ -775,7 +776,8 @@ class SequenceView(PGChildNodeView):
)
def _get_dependency(self, seid, show_system_objects=None):
dependencies_result = self.get_dependencies(self.conn, seid, None, show_system_objects)
dependencies_result = self.get_dependencies(self.conn, seid, None,
show_system_objects)
# Get missing dependencies.
# A Corner case, reported by Guillaume Lelarge, could be found at:

View File

@ -22,7 +22,6 @@ from regression.python_test_utils import test_utils as utils
from pgadmin.utils import server_utils as server_utils
class ColumnAddTestCase(BaseTestGenerator):
"""This class will add new column under table node."""
scenarios = [

View File

@ -23,7 +23,6 @@ from . import utils as columns_utils
from pgadmin.utils import server_utils as server_utils
class ColumnPutTestCase(BaseTestGenerator):
"""This class will update the column under table node."""
scenarios = [
@ -33,25 +32,25 @@ class ColumnPutTestCase(BaseTestGenerator):
col_data_type='bigint',
server_min_version=100000,
identity_opt={
'attidentity': 'a',
'seqincrement': 1,
'seqstart': 1,
'seqmin': 1,
'seqmax': 10,
'seqcache': 1,
'seqcycle': True
'attidentity': 'a',
'seqincrement': 1,
'seqstart': 1,
'seqmin': 1,
'seqmax': 10,
'seqcache': 1,
'seqcycle': True
})),
('EDit column with Identity', dict(url='/browser/column/obj/',
('Edit column with Identity', dict(url='/browser/column/obj/',
server_min_version=100000,
col_data_type='bigint',
identity_opt={
'attidentity': 'd',
'seqincrement': 2,
'seqstart': 2,
'seqmin': 2,
'seqmax': 2000,
'seqcache': 1,
'seqcycle': True
'attidentity': 'd',
'seqincrement': 2,
'seqstart': 2,
'seqmin': 2,
'seqmax': 2000,
'seqcache': 1,
'seqcycle': True
}))
]

View File

@ -360,7 +360,8 @@ class PGChildNodeView(NodeView):
)
)
def get_dependencies(self, conn, object_id, where=None, show_system_objects=None):
def get_dependencies(self, conn, object_id, where=None,
show_system_objects=None):
"""
This function is used to fetch the dependencies for the selected node.
@ -383,7 +384,8 @@ class PGChildNodeView(NodeView):
query = render_template("/".join([sql_path, 'dependencies.sql']),
where_clause=where_clause)
# fetch the dependency for the selected object
dependencies = self.__fetch_dependency(conn, query, show_system_objects)
dependencies = self.__fetch_dependency(conn, query,
show_system_objects)
# fetch role dependencies
if where_clause.find('subid') < 0: