From 6b5ca0771573de12db660addb73400a2d0794c4f Mon Sep 17 00:00:00 2001 From: Dave Page Date: Fri, 12 Jul 2019 13:55:18 +0100 Subject: [PATCH] Fix external utility tests to run on Windows --- .../tools/backup/tests/test_backup_create_job_unit_test.py | 4 ++++ web/pgadmin/tools/backup/tests/test_create_backup_job.py | 4 ++++ .../tools/maintenance/tests/test_create_maintenance_job.py | 4 ++++ .../tests/test_maintenance_create_job_unit_test.py | 4 ++++ web/pgadmin/tools/restore/tests/test_create_restore_job.py | 4 ++++ .../tools/restore/tests/test_restore_create_job_unit_test.py | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/web/pgadmin/tools/backup/tests/test_backup_create_job_unit_test.py b/web/pgadmin/tools/backup/tests/test_backup_create_job_unit_test.py index 693fde9ae..dd3aa6de9 100644 --- a/web/pgadmin/tools/backup/tests/test_backup_create_job_unit_test.py +++ b/web/pgadmin/tools/backup/tests/test_backup_create_job_unit_test.py @@ -653,6 +653,10 @@ class BackupCreateJobTest(BaseTestGenerator): binary_path = os.path.join( self.server['default_binary_paths'][self.server['type']], 'pg_dump') + + if os.name == 'nt': + binary_path = binary_path + '.exe' + retVal = does_utility_exist(binary_path) if retVal is not None: self.skipTest(retVal) diff --git a/web/pgadmin/tools/backup/tests/test_create_backup_job.py b/web/pgadmin/tools/backup/tests/test_create_backup_job.py index bc26a5a81..c9673db56 100644 --- a/web/pgadmin/tools/backup/tests/test_create_backup_job.py +++ b/web/pgadmin/tools/backup/tests/test_create_backup_job.py @@ -52,6 +52,10 @@ class BackupJobTest(BaseTestGenerator): binary_path = os.path.join( self.server['default_binary_paths'][self.server['type']], 'pg_dump') + + if os.name == 'nt': + binary_path = binary_path + '.exe' + retVal = does_utility_exist(binary_path) if retVal is not None: self.skipTest(retVal) diff --git a/web/pgadmin/tools/maintenance/tests/test_create_maintenance_job.py b/web/pgadmin/tools/maintenance/tests/test_create_maintenance_job.py index 23ac291b4..b1ab500d2 100644 --- a/web/pgadmin/tools/maintenance/tests/test_create_maintenance_job.py +++ b/web/pgadmin/tools/maintenance/tests/test_create_maintenance_job.py @@ -52,6 +52,10 @@ class MaintenanceJobTest(BaseTestGenerator): binary_path = os.path.join( self.server['default_binary_paths'][self.server['type']], 'psql') + + if os.name == 'nt': + binary_path = binary_path + '.exe' + retVal = does_utility_exist(binary_path) if retVal is not None: self.skipTest(retVal) diff --git a/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py b/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py index 9b60a38eb..94e7248ba 100644 --- a/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py +++ b/web/pgadmin/tools/maintenance/tests/test_maintenance_create_job_unit_test.py @@ -141,6 +141,10 @@ class MaintenanceCreateJobTest(BaseTestGenerator): binary_path = os.path.join( self.server['default_binary_paths'][self.server['type']], 'psql') + + if os.name == 'nt': + binary_path = binary_path + '.exe' + retVal = does_utility_exist(binary_path) if retVal is not None: self.skipTest(retVal) diff --git a/web/pgadmin/tools/restore/tests/test_create_restore_job.py b/web/pgadmin/tools/restore/tests/test_create_restore_job.py index 4a3201e05..6dc285437 100644 --- a/web/pgadmin/tools/restore/tests/test_create_restore_job.py +++ b/web/pgadmin/tools/restore/tests/test_create_restore_job.py @@ -75,6 +75,10 @@ class RestoreJobTest(BaseTestGenerator): binary_path = os.path.join( self.server['default_binary_paths'][self.server['type']], 'pg_restore') + + if os.name == 'nt': + binary_path = binary_path + '.exe' + retVal = does_utility_exist(binary_path) if retVal is not None: self.skipTest(retVal) diff --git a/web/pgadmin/tools/restore/tests/test_restore_create_job_unit_test.py b/web/pgadmin/tools/restore/tests/test_restore_create_job_unit_test.py index 69e02dc1d..af7b02397 100644 --- a/web/pgadmin/tools/restore/tests/test_restore_create_job_unit_test.py +++ b/web/pgadmin/tools/restore/tests/test_restore_create_job_unit_test.py @@ -305,6 +305,10 @@ class RestoreCreateJobTest(BaseTestGenerator): binary_path = os.path.join( self.server['default_binary_paths'][self.server['type']], 'pg_restore') + + if os.name == 'nt': + binary_path = binary_path + '.exe' + retVal = does_utility_exist(binary_path) if retVal is not None: self.skipTest(retVal)