mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix utility route check for Windows.
This commit is contained in:
parent
851c0cfff3
commit
f4f0fa0e47
@ -30,7 +30,7 @@ class TestUtilityCheckRouteCase(BaseTestGenerator):
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
check_binary_path_or_skip_test(self)
|
||||
check_binary_path_or_skip_test(self, 'pg_dump')
|
||||
|
||||
@patch('pgadmin.tools.backup.is_utility_exists')
|
||||
def runTest(self, is_utility_exists_mock):
|
||||
|
@ -30,7 +30,7 @@ class TestUtilityCheckRouteCase(BaseTestGenerator):
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
check_binary_path_or_skip_test(self)
|
||||
check_binary_path_or_skip_test(self, 'psql')
|
||||
|
||||
@patch('pgadmin.tools.import_export.is_utility_exists')
|
||||
def runTest(self, is_utility_exists_mock):
|
||||
|
@ -30,7 +30,7 @@ class TestUtilityCheckRouteCase(BaseTestGenerator):
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
check_binary_path_or_skip_test(self)
|
||||
check_binary_path_or_skip_test(self, 'psql')
|
||||
|
||||
@patch('pgadmin.tools.maintenance.is_utility_exists')
|
||||
def runTest(self, is_utility_exists_mock):
|
||||
|
@ -30,7 +30,7 @@ class TestUtilityCheckRouteCase(BaseTestGenerator):
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
check_binary_path_or_skip_test(self)
|
||||
check_binary_path_or_skip_test(self, 'pg_restore')
|
||||
|
||||
@patch('pgadmin.tools.restore.is_utility_exists')
|
||||
def runTest(self, is_utility_exists_mock):
|
||||
|
@ -966,7 +966,7 @@ def get_server_type(server):
|
||||
traceback.print_exc(file=sys.stderr)
|
||||
|
||||
|
||||
def check_binary_path_or_skip_test(cls):
|
||||
def check_binary_path_or_skip_test(cls, utility_name):
|
||||
if 'default_binary_paths' not in cls.server or \
|
||||
cls.server['default_binary_paths'] is None or \
|
||||
cls.server['type'] not in cls.server['default_binary_paths'] or \
|
||||
@ -976,3 +976,12 @@ def check_binary_path_or_skip_test(cls):
|
||||
cls.server['name']
|
||||
)
|
||||
)
|
||||
|
||||
from pgadmin.utils import is_utility_exists
|
||||
binary_path = os.path.join(
|
||||
cls.server['default_binary_paths'][cls.server['type']],
|
||||
utility_name
|
||||
)
|
||||
retVal = is_utility_exists(binary_path)
|
||||
if retVal is not None:
|
||||
cls.skipTest(retVal)
|
||||
|
Loading…
Reference in New Issue
Block a user