Skip to content

Commit

Permalink
tests: drop remaining parts of DSA-4371 workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarek committed Feb 28, 2022
1 parent 77dbc73 commit 3f5407d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions qubesmanager/tests/test_qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1605,9 +1605,8 @@ def test_20_update_vm_thread_dom0(self, check_call):
check_call.assert_called_once_with(
["/usr/bin/qubes-dom0-update", "--clean", "--gui"])

@unittest.mock.patch('builtins.open')
@unittest.mock.patch('subprocess.call')
def test_21_update_vm_thread_running(self, mock_call, mock_open):
def test_21_update_vm_thread_running(self, mock_call):
vm = unittest.mock.Mock(
spec=['klass', 'is_running', 'run_service_for_stdio', 'run_service'],
**{'is_running.return_value': True})
Expand All @@ -1619,17 +1618,13 @@ def test_21_update_vm_thread_running(self, mock_call, mock_open):

thread.run()

vm.run_service_for_stdio.assert_called_once_with(
"qubes.VMShell", user='root', input=unittest.mock.ANY)

vm.run_service.assert_called_once_with(
"qubes.InstallUpdatesGUI", user="root", wait=False)

self.assertEqual(mock_call.call_count, 0)

@unittest.mock.patch('builtins.open')
@unittest.mock.patch('subprocess.call')
def test_22_update_vm_thread_not_running(self, mock_call, mock_open):
def test_22_update_vm_thread_not_running(self, mock_call):
vm = unittest.mock.Mock(
spec=['klass', 'is_running', 'run_service_for_stdio',
'run_service', 'start', 'name'],
Expand All @@ -1643,13 +1638,10 @@ def test_22_update_vm_thread_not_running(self, mock_call, mock_open):

vm.start.assert_called_once_with()

vm.run_service_for_stdio.assert_called_once_with(
"qubes.VMShell", user='root', input=unittest.mock.ANY)

vm.run_service.assert_called_once_with(
"qubes.InstallUpdatesGUI", user="root", wait=False)

self.assertEqual(mock_call.call_count, 1)
self.assertEqual(mock_call.call_count, 0)

@unittest.mock.patch('builtins.open')
@unittest.mock.patch('subprocess.check_call')
Expand Down

0 comments on commit 3f5407d

Please sign in to comment.