Example #1
0
    def test_03_backup_thread_error(self):
        vm = unittest.mock.Mock(spec=['is_running', 'app'],
                                **{'is_running.return_value': True})

        vm.app = unittest.mock.Mock()
        vm.app.qubesd_call.side_effect = exc.QubesException('Error')

        thread = backup.BackupThread(vm)
        thread.run()

        self.assertIsNotNone(thread.msg)
Example #2
0
    def test_01_backup_thread_vm_on(self):
        vm = unittest.mock.Mock(spec=['is_running', 'app'],
                                **{'is_running.return_value': True})

        vm.app = unittest.mock.Mock()

        thread = backup.BackupThread(vm)
        thread.run()

        vm.app.qubesd_call.assert_called_with(
            'dom0', 'admin.backup.Execute', 'qubes-manager-backup-tmp')