PEP8 fixes.

This commit is contained in:
Murtuza Zabuawala 2018-02-26 13:54:58 +00:00 committed by Dave Page
parent 5ebd9ee8d3
commit fa9aebadbd
2 changed files with 29 additions and 16 deletions

View File

@ -9,8 +9,12 @@
import os
def compile_template_name(template_prefix, template_file_name, server_type, version):
return os.path.join(compile_template_path(template_prefix, server_type, version), template_file_name)
def compile_template_name(
template_prefix, template_file_name, server_type, version):
return os.path.join(
compile_template_path(template_prefix, server_type, version),
template_file_name
)
def compile_template_path(template_prefix, server_type, version):

View File

@ -12,23 +12,32 @@ from pgadmin.utils.route import BaseTestGenerator
class StartRunningQueryTest(BaseTestGenerator):
"""
Check that the apply_explain_plan_weapper_if_needed method works as intended
Check that the apply_explain_plan_weapper_if_needed method works as
intended
"""
scenarios = [
('When server is Postgres and version is 10, it returns the path to the postgres template', dict(
server_type='pg',
version=100000,
expected_return_value='some/prefix/#100000#/some_file.sql'
)),
('When server is GreenPlum and version is 5, it returns the path to the GreenPlum template', dict(
server_type='gpdb',
version=80323,
expected_return_value='some/prefix/#gpdb#80323#/some_file.sql'
)),
(
'When server is Postgres and version is 10, it returns the path '
'to the postgres template',
dict(
server_type='pg',
version=100000,
expected_return_value='some/prefix/#100000#/some_file.sql'
)
),
(
'When server is GreenPlum and version is 5, it returns the path '
'to the GreenPlum template',
dict(
server_type='gpdb',
version=80323,
expected_return_value='some/prefix/#gpdb#80323#/some_file.sql'
)
),
]
def runTest(self):
result = compile_template_name('some/prefix', 'some_file.sql', self.server_type, self.version)
result = compile_template_name(
'some/prefix', 'some_file.sql', self.server_type, self.version
)
self.assertEquals(result, self.expected_return_value)