diff --git a/README.md b/README.md index 8071c89..dafd105 100644 --- a/README.md +++ b/README.md @@ -19,3 +19,15 @@ This will keep translated strings, but will add new ones. ### Updating translations Commit updated `.ts` files into `i18n` directory. + + +Tests +---------------------- + +Located in the tests/ directory. + +To run qube manager and backup tests: + python3 test_name.py -v + +To run global settings tests: + sudo systemctl stop qubesd; sudo -E python3 test_global_settings.py -v ; sudo systemctl start qubesd diff --git a/qubesmanager/tests/instructions b/qubesmanager/tests/instructions deleted file mode 100644 index 0773293..0000000 --- a/qubesmanager/tests/instructions +++ /dev/null @@ -1,5 +0,0 @@ -To run qube manager and backup tests: -python3 test_name.py -v - -To run global settings tests: -sudo systemctl stop qubesd; sudo -E python3 test_global_settings.py -v ; sudo systemctl start qubesd \ No newline at end of file diff --git a/qubesmanager/tests/test_backup_01.py b/qubesmanager/tests/test_backup_01.py index 1aa8901..3470061 100644 --- a/qubesmanager/tests/test_backup_01.py +++ b/qubesmanager/tests/test_backup_01.py @@ -2,8 +2,8 @@ # # The Qubes OS Project, https://www.qubes-os.org/ # -# Copyright (C) 2016 Marek Marczykowski-Górecki -# +# Copyright (C) 2016 Marta Marczykowska-Górecka +# # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -49,10 +49,10 @@ class BackupTest(unittest.TestCase): del self.qapp super(BackupTest, self).tearDown() - def test_window_loads(self): + def test_00_window_loads(self): self.assertTrue(self.dialog.select_vms_widget is not None) - def test_vms_load_correctly(self): + def test_01_vms_load_correctly(self): all_vms = len([vm for vm in self.qapp.domains if not vm.features.get('internal', False)]) @@ -61,7 +61,7 @@ class BackupTest(unittest.TestCase): self.assertEqual(all_vms, available_vms + selected_vms) - def test_correct_defaults(self): + def test_02_correct_defaults(self): # backup is compressed self.assertTrue(self.dialog.compress_checkbox.isChecked(), "Compress backup should be checked by default") @@ -86,6 +86,7 @@ class BackupTest(unittest.TestCase): # Check if no default file loads correctly - another file?? # TODO: make a separate backup testing file to test various backup defaults + if __name__ == "__main__": ha_syslog = logging.handlers.SysLogHandler('/dev/log') ha_syslog.setFormatter( diff --git a/qubesmanager/tests/test_global_settings.py b/qubesmanager/tests/test_global_settings.py index 4be171a..dbccd5d 100644 --- a/qubesmanager/tests/test_global_settings.py +++ b/qubesmanager/tests/test_global_settings.py @@ -2,8 +2,8 @@ # # The Qubes OS Project, https://www.qubes-os.org/ # -# Copyright (C) 2016 Marek Marczykowski-Górecki -# +# Copyright (C) 2016 Marta Marczykowska-Górecka +# # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -231,7 +231,7 @@ class GlobalSettingsTest(SystemTestCase): self.assertEqual(self.app.default_template.name, new_def_template_name) @wrap_in_loop - def test__50_set_default_kernel(self): + def test_50_set_default_kernel(self): new_def_kernel_name = self.__set_noncurrent( self.dialog.default_kernel_combo) self.__click_ok() diff --git a/qubesmanager/tests/test_qube_manager.py b/qubesmanager/tests/test_qube_manager.py index e105423..46cd16c 100644 --- a/qubesmanager/tests/test_qube_manager.py +++ b/qubesmanager/tests/test_qube_manager.py @@ -2,8 +2,8 @@ # # The Qubes OS Project, https://www.qubes-os.org/ # -# Copyright (C) 2016 Marek Marczykowski-Górecki -# +# Copyright (C) 2016 Marta Marczykowska-Górecka +# # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -100,8 +100,6 @@ class QubeManagerTest(unittest.TestCase): @unittest.mock.patch('qubesmanager.qubesadmin.vm.QubesVM.pause') @unittest.mock.patch('qubesmanager.qubesadmin.vm.QubesVM.is_running') @unittest.mock.patch('qubesmanager.qubesadmin.vm.QubesVM.get_power_state') - - def _select_non_admin_vm(self): for row in range(self.dialog.table.rowCount()): template = self.dialog.table.item( diff --git a/rpm_spec/qmgr.spec.in b/rpm_spec/qmgr.spec.in index 2a44416..c2de6bf 100644 --- a/rpm_spec/qmgr.spec.in +++ b/rpm_spec/qmgr.spec.in @@ -113,6 +113,12 @@ rm -rf $RPM_BUILD_ROOT %{python3_sitelib}/qubesmanager/i18n/qubesmanager_*.qm %{python3_sitelib}/qubesmanager/i18n/qubesmanager_*.ts +%{python3_sitelib}/qubesmanager/tests/__pycache__ +%{python3_sitelib}/qubesmanager/tests/__init__.py +%{python3_sitelib}/qubesmanager/tests/test_backup_01.py +%{python3_sitelib}/qubesmanager/tests/test_global_settings.py +%{python3_sitelib}/qubesmanager/tests/test_qube_manager.py + %dir %{python3_sitelib}/qubesmanager-*.egg-info %{python3_sitelib}/qubesmanager-*.egg-info/* diff --git a/setup.py b/setup.py index f0388a8..721284c 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ if __name__ == '__main__': description='Qubes OS Manager', license='GPL2+', url='https://www.qubes-os.org/', - packages=setuptools.find_packages(exclude=['qubesmanager.tests']), + packages=setuptools.find_packages(), package_data={ 'qubesmanager': ['i18n/*'] },