From ba2b034843ad9bfc6a862137d43efa80b8b43775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Tue, 25 Jul 2017 05:34:38 +0200 Subject: [PATCH] tests: minor fixes to api/admin tests Drop debug print, fix mocking Storage.remove (it is a coroutine). --- qubes/tests/api_admin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qubes/tests/api_admin.py b/qubes/tests/api_admin.py index 9723e549..9bc52a57 100644 --- a/qubes/tests/api_admin.py +++ b/qubes/tests/api_admin.py @@ -422,7 +422,6 @@ class TC_00_VMs(AdminAPITestCase): value = self.call_mgmt_func(b'admin.vm.volume.Revert', b'test-vm1', b'private', b'rev1') self.assertIsNone(value) - print(repr(self.vm.volumes.mock_calls)) self.assertEqual(self.vm.volumes.mock_calls, [ ('__getitem__', ('private', ), {}), ('__getitem__().revert', ('rev1', ), {}), @@ -1532,6 +1531,7 @@ class TC_00_VMs(AdminAPITestCase): @unittest.mock.patch('qubes.storage.Storage.remove') @unittest.mock.patch('shutil.rmtree') def test_500_vm_remove(self, mock_rmtree, mock_remove): + mock_remove.side_effect = self.dummy_coro value = self.call_mgmt_func(b'admin.vm.Remove', b'test-vm1') self.assertIsNone(value) mock_rmtree.assert_called_once_with( @@ -1542,6 +1542,7 @@ class TC_00_VMs(AdminAPITestCase): @unittest.mock.patch('qubes.storage.Storage.remove') @unittest.mock.patch('shutil.rmtree') def test_501_vm_remove_running(self, mock_rmtree, mock_remove): + mock_remove.side_effect = self.dummy_coro with unittest.mock.patch.object( self.vm, 'get_power_state', lambda: 'Running'): with self.assertRaises(qubes.exc.QubesVMNotHaltedError):