Fixed BatchProcessTest cases failing on Jenkins.

This commit is contained in:
Khushboo Vashi 2020-11-19 18:09:35 +05:30 committed by Akshay Joshi
parent 3e2a1c4eca
commit 29c3c0cf7f
2 changed files with 10 additions and 4 deletions

View File

@ -142,8 +142,10 @@ class BatchProcessTest(BaseTestGenerator):
@patch('pgadmin.misc.bgprocess.processes.Process')
@patch('pgadmin.misc.bgprocess.processes.BatchProcess.'
'update_process_info')
def _check_list(self, p, maintenance_obj, update_process_info_mock,
process_mock):
@patch('pgadmin.misc.bgprocess.processes.BatchProcess.'
'_operate_orphan_process')
def _check_list(self, p, maintenance_obj, _operate_orphan_process_mock,
update_process_info_mock, process_mock):
class TestMockProcess():
def __init__(self, desc, args, cmd):
self.pid = 1
@ -163,6 +165,7 @@ class BatchProcessTest(BaseTestGenerator):
]
update_process_info_mock.return_value = [True, True]
_operate_orphan_process_mock.return_value = False
ret_value = p.list()
self.assertEqual(1, len(ret_value))

View File

@ -142,8 +142,10 @@ class BatchProcessTest(BaseTestGenerator):
@patch('pgadmin.misc.bgprocess.processes.Process')
@patch('pgadmin.misc.bgprocess.processes.BatchProcess.'
'update_process_info')
def _check_list(self, p, restore_obj, update_process_info_mock,
process_mock):
@patch('pgadmin.misc.bgprocess.processes.BatchProcess.'
'_operate_orphan_process')
def _check_list(self, p, restore_obj, _operate_orphan_process_mock,
update_process_info_mock, process_mock):
class TestMockProcess():
def __init__(self, desc, args, cmd):
self.pid = 1
@ -163,6 +165,7 @@ class BatchProcessTest(BaseTestGenerator):
]
update_process_info_mock.return_value = [True, True]
_operate_orphan_process_mock.return_value = False
ret_value = p.list()
self.assertEqual(1, len(ret_value))