Fixed tests for new debug mode location in VM settings

This commit is contained in:
Marta Marczykowska-Górecka 2020-02-28 18:58:20 +01:00
parent 92465f71e7
commit cf601fbc66
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B

View File

@ -128,10 +128,6 @@ class VMSettingsTest(unittest.TestCase):
self.vm.include_in_backups, self.vm.include_in_backups,
"Incorrect 'include in backups' state") "Incorrect 'include in backups' state")
self.assertEqual(self.dialog.run_in_debug_mode.isChecked(),
self.vm.debug,
"Incorrect 'run in debug mode' state")
self.assertEqual(self.dialog.autostart_vm.isChecked(), self.assertEqual(self.dialog.autostart_vm.isChecked(),
self.vm.autostart, self.vm.autostart,
"Incorrect 'autostart' state") "Incorrect 'autostart' state")
@ -259,7 +255,6 @@ class VMSettingsTest(unittest.TestCase):
self.dialog.include_in_backups.setChecked(True) self.dialog.include_in_backups.setChecked(True)
self.dialog.autostart_vm.setChecked(True) self.dialog.autostart_vm.setChecked(True)
self.dialog.run_in_debug_mode.setChecked(True)
self._click_ok() self._click_ok()
@ -267,8 +262,6 @@ class VMSettingsTest(unittest.TestCase):
"Include in backups not set to true") "Include in backups not set to true")
self.assertTrue(self.vm.autostart, self.assertTrue(self.vm.autostart,
"Autostart not set to true") "Autostart not set to true")
self.assertTrue(self.vm.debug,
"Debug mode not set to true")
def test_09_basic_checkboxes_false(self): def test_09_basic_checkboxes_false(self):
self.vm = self.qapp.add_new_vm("AppVM", "test-vm", "blue") self.vm = self.qapp.add_new_vm("AppVM", "test-vm", "blue")
@ -278,7 +271,6 @@ class VMSettingsTest(unittest.TestCase):
self.dialog.include_in_backups.setChecked(False) self.dialog.include_in_backups.setChecked(False)
self.dialog.autostart_vm.setChecked(False) self.dialog.autostart_vm.setChecked(False)
self.dialog.run_in_debug_mode.setChecked(False)
self._click_ok() self._click_ok()
@ -286,8 +278,6 @@ class VMSettingsTest(unittest.TestCase):
"Include in backups not set to false") "Include in backups not set to false")
self.assertFalse(self.vm.autostart, self.assertFalse(self.vm.autostart,
"Autostart not set to false") "Autostart not set to false")
self.assertFalse(self.vm.debug,
"Debug mode not set to false")
def test_10_increase_private_storage(self): def test_10_increase_private_storage(self):
self.vm = self.qapp.add_new_vm("AppVM", "test-vm", "blue") self.vm = self.qapp.add_new_vm("AppVM", "test-vm", "blue")
@ -379,6 +369,11 @@ class VMSettingsTest(unittest.TestCase):
self.assertTrue(self.dialog.include_in_balancing.isChecked(), self.assertTrue(self.dialog.include_in_balancing.isChecked(),
"Include in memory balancing incorrectly not checked") "Include in memory balancing incorrectly not checked")
# debug mode
self.assertEqual(self.dialog.run_in_debug_mode.isChecked(),
self.vm.debug,
"Incorrect 'run in debug mode' state")
# kernel # kernel
self.assertTrue(self.vm.kernel in self.dialog.kernel.currentText(), self.assertTrue(self.vm.kernel in self.dialog.kernel.currentText(),
"Kernel displayed incorrectly") "Kernel displayed incorrectly")
@ -530,6 +525,32 @@ class VMSettingsTest(unittest.TestCase):
self.dialog.boot_from_device_button.click() self.dialog.boot_from_device_button.click()
mock_call.assert_called_with(['qubes-vm-boot-from-device', "test-vm"]) mock_call.assert_called_with(['qubes-vm-boot-from-device', "test-vm"])
def test_28_advanced_debug_false(self):
self.vm = self.qapp.add_new_vm("AppVM", "test-vm", "blue")
self.dialog = vm_settings.VMSettingsWindow(
self.vm, qapp=self.qtapp, qubesapp=self.qapp, init_page="advanced")
self.dialog.show()
self.dialog.run_in_debug_mode.setChecked(False)
self._click_ok()
self.assertFalse(self.vm.debug,
"Debug mode not set to false")
def test_28_advanced_debug_true(self):
self.vm = self.qapp.add_new_vm("AppVM", "test-vm", "blue")
self.dialog = vm_settings.VMSettingsWindow(
self.vm, qapp=self.qtapp, qubesapp=self.qapp, init_page="advanced")
self.dialog.show()
self.dialog.run_in_debug_mode.setChecked(True)
self._click_ok()
self.assertTrue(self.vm.debug,
"Debug mode not set to true")
def _click_ok(self): def _click_ok(self):
okwidget = self.dialog.buttonBox.button( okwidget = self.dialog.buttonBox.button(
self.dialog.buttonBox.Ok) self.dialog.buttonBox.Ok)