From b831ebd48ed05ccd4977d71e149b0e97600d5958 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 10 Mar 2014 20:53:11 +0100 Subject: [PATCH 1/7] Use ICU for locale sort key --- openlp/core/utils/__init__.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 426606987..1e358454f 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -426,17 +426,14 @@ def get_locale_key(string): The corresponding string. """ string = string.lower() - # For Python 3 on platforms other than Windows ICU is not necessary. In those cases locale.strxfrm(str) can be used. - if os.name == 'nt': - global ICU_COLLATOR - if ICU_COLLATOR is None: - import icu - from .languagemanager import LanguageManager - language = LanguageManager.get_language() - icu_locale = icu.Locale(language) - ICU_COLLATOR = icu.Collator.createInstance(icu_locale) - return ICU_COLLATOR.getSortKey(string) - return locale.strxfrm(string).encode() + global ICU_COLLATOR + if ICU_COLLATOR is None: + import icu + from .languagemanager import LanguageManager + language = LanguageManager.get_language() + icu_locale = icu.Locale(language) + ICU_COLLATOR = icu.Collator.createInstance(icu_locale) + return ICU_COLLATOR.getSortKey(string) def get_natural_key(string): From 2b55da02c11214b9c9c8a5f61936c4495bbf084c Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Mon, 10 Mar 2014 20:56:36 +0100 Subject: [PATCH 2/7] Reuse QApplication instance to avoid segfaults. --- tests/interfaces/openlp_core_lib/test_pluginmanager.py | 9 ++++++--- tests/interfaces/openlp_core_ui/test_filerenamedialog.py | 9 ++++++--- .../interfaces/openlp_core_ui/test_listpreviewwidget.py | 9 ++++++--- tests/interfaces/openlp_core_ui/test_mainwindow.py | 9 ++++++--- tests/interfaces/openlp_core_ui/test_servicemanager.py | 7 +++++-- .../interfaces/openlp_core_ui/test_servicenotedialog.py | 7 +++++-- tests/interfaces/openlp_core_ui/test_settings_form.py | 7 +++++-- tests/interfaces/openlp_core_ui/test_starttimedialog.py | 7 +++++-- tests/interfaces/openlp_core_ui/test_thememanager.py | 9 ++++++--- .../openlp_plugins/custom/forms/test_customform.py | 7 +++++-- .../openlp_plugins/custom/forms/test_customslideform.py | 9 ++++++--- .../openlp_plugins/songs/forms/test_authorsform.py | 9 ++++++--- .../openlp_plugins/songs/forms/test_editsongform.py | 9 ++++++--- .../openlp_plugins/songs/forms/test_editverseform.py | 7 +++++-- .../openlp_plugins/songs/forms/test_topicsform.py | 9 ++++++--- 15 files changed, 84 insertions(+), 39 deletions(-) diff --git a/tests/interfaces/openlp_core_lib/test_pluginmanager.py b/tests/interfaces/openlp_core_lib/test_pluginmanager.py index 9e8dc534b..0306a33ff 100644 --- a/tests/interfaces/openlp_core_lib/test_pluginmanager.py +++ b/tests/interfaces/openlp_core_lib/test_pluginmanager.py @@ -7,7 +7,7 @@ import shutil from tempfile import mkstemp, mkdtemp from unittest import TestCase -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore from openlp.core.common import Registry, Settings from openlp.core.lib.pluginmanager import PluginManager @@ -29,12 +29,15 @@ class TestPluginManager(TestCase): Settings().setValue('advanced/data path', self.temp_dir) Registry.create() Registry().register('service_list', MagicMock()) - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.main_window = QtGui.QMainWindow() Registry().register('main_window', self.main_window) def tearDown(self): - del self.app del self.main_window Settings().remove('advanced/data path') shutil.rmtree(self.temp_dir) diff --git a/tests/interfaces/openlp_core_ui/test_filerenamedialog.py b/tests/interfaces/openlp_core_ui/test_filerenamedialog.py index fabefc427..8fac36213 100644 --- a/tests/interfaces/openlp_core_ui/test_filerenamedialog.py +++ b/tests/interfaces/openlp_core_ui/test_filerenamedialog.py @@ -3,7 +3,7 @@ """ from unittest import TestCase -from PyQt4 import QtGui, QtTest +from PyQt4 import QtCore, QtGui, QtTest from openlp.core.common import Registry from openlp.core.ui import filerenameform @@ -17,7 +17,11 @@ class TestStartFileRenameForm(TestCase): Create the UI """ Registry.create() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.main_window = QtGui.QMainWindow() Registry().register('main_window', self.main_window) self.form = filerenameform.FileRenameForm() @@ -28,7 +32,6 @@ class TestStartFileRenameForm(TestCase): """ del self.form del self.main_window - del self.app def window_title_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py b/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py index 6d638cdd1..7b91ce152 100644 --- a/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py +++ b/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py @@ -4,7 +4,7 @@ from unittest import TestCase -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore from openlp.core.common import Registry from openlp.core.lib import ServiceItem @@ -20,7 +20,11 @@ class TestListPreviewWidget(TestCase): Create the UI. """ Registry.create() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.main_window = QtGui.QMainWindow() self.image = QtGui.QImage(1, 1, QtGui.QImage.Format_RGB32) self.image_manager = MagicMock() @@ -34,7 +38,6 @@ class TestListPreviewWidget(TestCase): """ del self.preview_widget del self.main_window - del self.app def initial_slide_count_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_mainwindow.py b/tests/interfaces/openlp_core_ui/test_mainwindow.py index 279fe15db..db55f53ec 100644 --- a/tests/interfaces/openlp_core_ui/test_mainwindow.py +++ b/tests/interfaces/openlp_core_ui/test_mainwindow.py @@ -3,7 +3,7 @@ Package to test the openlp.core.ui.mainwindow package. """ from unittest import TestCase -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore from openlp.core.common import Registry from openlp.core.ui.mainwindow import MainWindow @@ -18,7 +18,11 @@ class TestMainWindow(TestCase): """ Registry.create() self.registry = Registry() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance # Mock cursor busy/normal methods. self.app.set_busy_cursor = MagicMock() self.app.set_normal_cursor = MagicMock() @@ -42,7 +46,6 @@ class TestMainWindow(TestCase): Delete all the C++ objects at the end so that we don't have a segfault """ del self.main_window - del self.app def restore_current_media_manager_item_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_servicemanager.py b/tests/interfaces/openlp_core_ui/test_servicemanager.py index 5e4d5dead..7487b22e2 100644 --- a/tests/interfaces/openlp_core_ui/test_servicemanager.py +++ b/tests/interfaces/openlp_core_ui/test_servicemanager.py @@ -19,7 +19,11 @@ class TestServiceManager(TestCase): Create the UI """ Registry.create() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance ScreenList.create(self.app.desktop()) Registry().register('application', MagicMock()) with patch('openlp.core.lib.PluginManager'): @@ -31,7 +35,6 @@ class TestServiceManager(TestCase): Delete all the C++ objects at the end so that we don't have a segfault """ del self.main_window - del self.app def basic_service_manager_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_servicenotedialog.py b/tests/interfaces/openlp_core_ui/test_servicenotedialog.py index e8aa70ede..4a0f0acff 100644 --- a/tests/interfaces/openlp_core_ui/test_servicenotedialog.py +++ b/tests/interfaces/openlp_core_ui/test_servicenotedialog.py @@ -17,7 +17,11 @@ class TestStartNoteDialog(TestCase): Create the UI """ Registry.create() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.main_window = QtGui.QMainWindow() Registry().register('main_window', self.main_window) self.form = servicenoteform.ServiceNoteForm() @@ -28,7 +32,6 @@ class TestStartNoteDialog(TestCase): """ del self.form del self.main_window - del self.app def basic_display_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_settings_form.py b/tests/interfaces/openlp_core_ui/test_settings_form.py index c475df994..904f7d5dd 100644 --- a/tests/interfaces/openlp_core_ui/test_settings_form.py +++ b/tests/interfaces/openlp_core_ui/test_settings_form.py @@ -31,7 +31,11 @@ class TestSettingsForm(TestCase): self.dummy2 = MagicMock() self.dummy3 = MagicMock() self.desktop = MagicMock() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.desktop.primaryScreen.return_value = SCREEN['primary'] self.desktop.screenCount.return_value = SCREEN['number'] self.desktop.screenGeometry.return_value = SCREEN['size'] @@ -44,7 +48,6 @@ class TestSettingsForm(TestCase): Delete all the C++ objects at the end so that we don't have a segfault """ del self.form - del self.app def basic_cancel_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_starttimedialog.py b/tests/interfaces/openlp_core_ui/test_starttimedialog.py index 709a5d68f..b9d16852a 100644 --- a/tests/interfaces/openlp_core_ui/test_starttimedialog.py +++ b/tests/interfaces/openlp_core_ui/test_starttimedialog.py @@ -17,7 +17,11 @@ class TestStartTimeDialog(TestCase): Create the UI """ Registry.create() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.main_window = QtGui.QMainWindow() Registry().register('main_window', self.main_window) self.form = starttimeform.StartTimeForm() @@ -28,7 +32,6 @@ class TestStartTimeDialog(TestCase): """ del self.form del self.main_window - del self.app def ui_defaults_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_thememanager.py b/tests/interfaces/openlp_core_ui/test_thememanager.py index 17a22f215..c2b3f0764 100644 --- a/tests/interfaces/openlp_core_ui/test_thememanager.py +++ b/tests/interfaces/openlp_core_ui/test_thememanager.py @@ -33,7 +33,7 @@ import os from unittest import TestCase from tempfile import mkstemp -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore from openlp.core.common import Registry, Settings from openlp.core.ui import ThemeManager @@ -50,7 +50,11 @@ class TestThemeManager(TestCase): """ fd, self.ini_file = mkstemp('.ini') Settings().set_filename(self.ini_file) - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance Registry.create() self.theme_manager = ThemeManager() @@ -60,7 +64,6 @@ class TestThemeManager(TestCase): """ os.unlink(self.ini_file) os.unlink(Settings().fileName()) - del self.app def initialise_test(self): """ diff --git a/tests/interfaces/openlp_plugins/custom/forms/test_customform.py b/tests/interfaces/openlp_plugins/custom/forms/test_customform.py index e933bb17d..e98778926 100644 --- a/tests/interfaces/openlp_plugins/custom/forms/test_customform.py +++ b/tests/interfaces/openlp_plugins/custom/forms/test_customform.py @@ -21,7 +21,11 @@ class TestEditCustomForm(TestCase): Create the UI """ Registry.create() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.main_window = QtGui.QMainWindow() Registry().register('main_window', self.main_window) media_item = MagicMock() @@ -34,7 +38,6 @@ class TestEditCustomForm(TestCase): """ del self.form del self.main_window - del self.app def load_themes_test(self): """ diff --git a/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py b/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py index f98ae376e..ece444b07 100644 --- a/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py +++ b/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py @@ -3,7 +3,7 @@ Module to test the EditCustomSlideForm. """ from unittest import TestCase -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore from openlp.core.common import Registry from openlp.plugins.custom.forms.editcustomslideform import EditCustomSlideForm @@ -19,7 +19,11 @@ class TestEditCustomSlideForm(TestCase): Create the UI """ Registry.create() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.main_window = QtGui.QMainWindow() Registry().register('main_window', self.main_window) self.form = EditCustomSlideForm() @@ -30,7 +34,6 @@ class TestEditCustomSlideForm(TestCase): """ del self.form del self.main_window - del self.app def basic_test(self): """ diff --git a/tests/interfaces/openlp_plugins/songs/forms/test_authorsform.py b/tests/interfaces/openlp_plugins/songs/forms/test_authorsform.py index f4dc5c228..0aea0a626 100644 --- a/tests/interfaces/openlp_plugins/songs/forms/test_authorsform.py +++ b/tests/interfaces/openlp_plugins/songs/forms/test_authorsform.py @@ -3,7 +3,7 @@ Package to test the openlp.plugins.songs.forms.authorsform package. """ from unittest import TestCase -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore from openlp.core.common import Registry from openlp.plugins.songs.forms.authorsform import AuthorsForm @@ -19,7 +19,11 @@ class TestAuthorsForm(TestCase): Create the UI """ Registry.create() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.main_window = QtGui.QMainWindow() Registry().register('main_window', self.main_window) self.form = AuthorsForm() @@ -30,7 +34,6 @@ class TestAuthorsForm(TestCase): """ del self.form del self.main_window - del self.app def ui_defaults_test(self): """ diff --git a/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py b/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py index 6804858a4..010d9d0f0 100644 --- a/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py +++ b/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py @@ -3,7 +3,7 @@ Package to test the openlp.plugins.songs.forms.editsongform package. """ from unittest import TestCase -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore from openlp.core.common import Registry from openlp.plugins.songs.forms.editsongform import EditSongForm @@ -20,7 +20,11 @@ class TestEditSongForm(TestCase): Create the UI """ Registry.create() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.main_window = QtGui.QMainWindow() Registry().register('main_window', self.main_window) Registry().register('theme_manager', MagicMock()) @@ -32,7 +36,6 @@ class TestEditSongForm(TestCase): """ del self.form del self.main_window - del self.app def ui_defaults_test(self): """ diff --git a/tests/interfaces/openlp_plugins/songs/forms/test_editverseform.py b/tests/interfaces/openlp_plugins/songs/forms/test_editverseform.py index f047903bc..592827546 100644 --- a/tests/interfaces/openlp_plugins/songs/forms/test_editverseform.py +++ b/tests/interfaces/openlp_plugins/songs/forms/test_editverseform.py @@ -19,7 +19,11 @@ class TestEditVerseForm(TestCase): Create the UI """ Registry.create() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.main_window = QtGui.QMainWindow() Registry().register('main_window', self.main_window) self.form = EditVerseForm() @@ -30,7 +34,6 @@ class TestEditVerseForm(TestCase): """ del self.form del self.main_window - del self.app def ui_defaults_test(self): """ diff --git a/tests/interfaces/openlp_plugins/songs/forms/test_topicsform.py b/tests/interfaces/openlp_plugins/songs/forms/test_topicsform.py index c8057c4ea..7fde007f0 100644 --- a/tests/interfaces/openlp_plugins/songs/forms/test_topicsform.py +++ b/tests/interfaces/openlp_plugins/songs/forms/test_topicsform.py @@ -3,7 +3,7 @@ Package to test the openlp.plugins.songs.forms.topicsform package. """ from unittest import TestCase -from PyQt4 import QtGui +from PyQt4 import QtGui, QtCore from openlp.core.common import Registry from openlp.plugins.songs.forms.topicsform import TopicsForm @@ -19,7 +19,11 @@ class TestTopicsForm(TestCase): Create the UI """ Registry.create() - self.app = QtGui.QApplication([]) + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance self.main_window = QtGui.QMainWindow() Registry().register('main_window', self.main_window) self.form = TopicsForm() @@ -30,7 +34,6 @@ class TestTopicsForm(TestCase): """ del self.form del self.main_window - del self.app def ui_defaults_test(self): """ From 5ac6f853d0b345f8f3fc59d34b57d4adca0c44bd Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Tue, 11 Mar 2014 20:38:47 +0100 Subject: [PATCH 3/7] Changed get_locale_key to only use ICU if available. --- openlp/core/utils/__init__.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/openlp/core/utils/__init__.py b/openlp/core/utils/__init__.py index 1e358454f..510528bcb 100644 --- a/openlp/core/utils/__init__.py +++ b/openlp/core/utils/__init__.py @@ -426,15 +426,18 @@ def get_locale_key(string): The corresponding string. """ string = string.lower() + # ICU is the prefered way to handle locale sort key, we fallback to locale.strxfrm which will work in most cases. global ICU_COLLATOR - if ICU_COLLATOR is None: - import icu - from .languagemanager import LanguageManager - language = LanguageManager.get_language() - icu_locale = icu.Locale(language) - ICU_COLLATOR = icu.Collator.createInstance(icu_locale) - return ICU_COLLATOR.getSortKey(string) - + try: + if ICU_COLLATOR is None: + import icu + from .languagemanager import LanguageManager + language = LanguageManager.get_language() + icu_locale = icu.Locale(language) + ICU_COLLATOR = icu.Collator.createInstance(icu_locale) + return ICU_COLLATOR.getSortKey(string) + except: + return locale.strxfrm(string).encode() def get_natural_key(string): """ From 6f05711414c0d4a0cbf322e592bb43e0e018f7d6 Mon Sep 17 00:00:00 2001 From: Jonathan Springer Date: Wed, 12 Mar 2014 01:31:19 -0400 Subject: [PATCH 4/7] Fixes settings initialization in tests to actually use temporary ini file. --- tests/functional/openlp_core_common/test_settings.py | 2 +- tests/functional/openlp_core_utils/test_actions.py | 2 +- .../openlp_plugins/presentations/test_pdfcontroller.py | 3 ++- tests/functional/openlp_plugins/remotes/test_remotetab.py | 3 ++- tests/functional/openlp_plugins/remotes/test_router.py | 3 ++- tests/functional/openlp_plugins/songs/test_mediaitem.py | 2 +- tests/interfaces/openlp_core_lib/test_pluginmanager.py | 3 ++- tests/interfaces/openlp_core_ui/test_thememanager.py | 2 +- 8 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/functional/openlp_core_common/test_settings.py b/tests/functional/openlp_core_common/test_settings.py index 7fd49f755..304281c31 100644 --- a/tests/functional/openlp_core_common/test_settings.py +++ b/tests/functional/openlp_core_common/test_settings.py @@ -46,6 +46,7 @@ class TestSettings(TestCase): """ Create the UI """ + Settings.setDefaultFormat(Settings.IniFormat) fd, self.ini_file = mkstemp('.ini') Settings().set_filename(self.ini_file) self.application = QtGui.QApplication.instance() @@ -55,7 +56,6 @@ class TestSettings(TestCase): Delete all the C++ objects at the end so that we don't have a segfault """ del self.application - os.unlink(self.ini_file) os.unlink(Settings().fileName()) def settings_basic_test(self): diff --git a/tests/functional/openlp_core_utils/test_actions.py b/tests/functional/openlp_core_utils/test_actions.py index 5fb7a3aee..f44ddfafd 100644 --- a/tests/functional/openlp_core_utils/test_actions.py +++ b/tests/functional/openlp_core_utils/test_actions.py @@ -59,7 +59,7 @@ class TestActionList(TestCase): Clean up """ self.settings.endGroup() - os.unlink(self.ini_file) + os.unlink(Settings().fileName()) def test_add_action_same_parent(self): """ diff --git a/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py b/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py index 6dba4ac90..d426c7af2 100644 --- a/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py @@ -55,6 +55,7 @@ class TestPdfController(TestCase): """ Set up the components need for all tests. """ + Settings.setDefaultFormat(Settings.IniFormat) self.fd, self.ini_file = mkstemp('.ini') Settings().set_filename(self.ini_file) self.application = QtGui.QApplication.instance() @@ -69,7 +70,7 @@ class TestPdfController(TestCase): """ del self.application try: - os.unlink(self.ini_file) + os.unlink(Settings().fileName()) shutil.rmtree(self.thumbnail_folder) shutil.rmtree(self.temp_folder) except OSError: diff --git a/tests/functional/openlp_plugins/remotes/test_remotetab.py b/tests/functional/openlp_plugins/remotes/test_remotetab.py index 44b719d95..ca965d234 100644 --- a/tests/functional/openlp_plugins/remotes/test_remotetab.py +++ b/tests/functional/openlp_plugins/remotes/test_remotetab.py @@ -62,6 +62,7 @@ class TestRemoteTab(TestCase): """ Create the UI """ + Settings.setDefaultFormat(Settings.IniFormat) self.fd, self.ini_file = mkstemp('.ini') Settings().set_filename(self.ini_file) self.application = QtGui.QApplication.instance() @@ -77,7 +78,7 @@ class TestRemoteTab(TestCase): del self.parent del self.form os.close(self.fd) - os.unlink(self.ini_file) + os.unlink(Settings().fileName()) def get_ip_address_default_test(self): """ diff --git a/tests/functional/openlp_plugins/remotes/test_router.py b/tests/functional/openlp_plugins/remotes/test_router.py index 7f42a8cad..a1c9936c1 100644 --- a/tests/functional/openlp_plugins/remotes/test_router.py +++ b/tests/functional/openlp_plugins/remotes/test_router.py @@ -61,6 +61,7 @@ class TestRouter(TestCase): """ Create the UI """ + Settings.setDefaultFormat(Settings.IniFormat) self.fd, self.ini_file = mkstemp('.ini') Settings().set_filename(self.ini_file) self.application = QtGui.QApplication.instance() @@ -73,7 +74,7 @@ class TestRouter(TestCase): """ del self.application os.close(self.fd) - os.unlink(self.ini_file) + os.unlink(Settings().fileName()) def password_encrypter_test(self): """ diff --git a/tests/functional/openlp_plugins/songs/test_mediaitem.py b/tests/functional/openlp_plugins/songs/test_mediaitem.py index a823c230e..7113c2c6c 100644 --- a/tests/functional/openlp_plugins/songs/test_mediaitem.py +++ b/tests/functional/openlp_plugins/songs/test_mediaitem.py @@ -28,6 +28,7 @@ class TestMediaItem(TestCase): patch('openlp.plugins.songs.forms.editsongform.EditSongForm.__init__'): self.media_item = SongMediaItem(None, MagicMock()) + Settings.setDefaultFormat(Settings.IniFormat) fd, self.ini_file = mkstemp('.ini') Settings().set_filename(self.ini_file) self.application = QtGui.QApplication.instance() @@ -40,7 +41,6 @@ class TestMediaItem(TestCase): del self.application # Not all tests use settings! try: - os.unlink(self.ini_file) os.unlink(Settings().fileName()) except Exception: pass diff --git a/tests/interfaces/openlp_core_lib/test_pluginmanager.py b/tests/interfaces/openlp_core_lib/test_pluginmanager.py index 9e8dc534b..4981d8cfa 100644 --- a/tests/interfaces/openlp_core_lib/test_pluginmanager.py +++ b/tests/interfaces/openlp_core_lib/test_pluginmanager.py @@ -23,6 +23,7 @@ class TestPluginManager(TestCase): """ Some pre-test setup required. """ + Settings.setDefaultFormat(Settings.IniFormat) fd, self.ini_file = mkstemp('.ini') self.temp_dir = mkdtemp('openlp') Settings().set_filename(self.ini_file) @@ -38,7 +39,7 @@ class TestPluginManager(TestCase): del self.main_window Settings().remove('advanced/data path') shutil.rmtree(self.temp_dir) - os.unlink(self.ini_file) + os.unlink(Settings().fileName()) def find_plugins_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_thememanager.py b/tests/interfaces/openlp_core_ui/test_thememanager.py index 17a22f215..bc9473c54 100644 --- a/tests/interfaces/openlp_core_ui/test_thememanager.py +++ b/tests/interfaces/openlp_core_ui/test_thememanager.py @@ -48,6 +48,7 @@ class TestThemeManager(TestCase): """ Create the UI """ + Settings.setDefaultFormat(Settings.IniFormat) fd, self.ini_file = mkstemp('.ini') Settings().set_filename(self.ini_file) self.app = QtGui.QApplication([]) @@ -58,7 +59,6 @@ class TestThemeManager(TestCase): """ Delete all the C++ objects at the end so that we don't have a segfault """ - os.unlink(self.ini_file) os.unlink(Settings().fileName()) del self.app From 92e9ef93948f74398a47fbff29e0bb1635a95a19 Mon Sep 17 00:00:00 2001 From: Jonathan Springer Date: Wed, 12 Mar 2014 15:05:06 -0400 Subject: [PATCH 5/7] Missed one --- tests/functional/openlp_core_utils/test_actions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/functional/openlp_core_utils/test_actions.py b/tests/functional/openlp_core_utils/test_actions.py index f44ddfafd..125154623 100644 --- a/tests/functional/openlp_core_utils/test_actions.py +++ b/tests/functional/openlp_core_utils/test_actions.py @@ -49,6 +49,7 @@ class TestActionList(TestCase): Prepare the tests """ self.action_list = ActionList.get_instance() + Settings.setDefaultFormat(Settings.IniFormat) self.settings = Settings() fd, self.ini_file = mkstemp('.ini') self.settings.set_filename(self.ini_file) From ed03ec2195cc82eaa470dcf9bb80e8ccb8838f4f Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Thu, 13 Mar 2014 21:59:10 +0100 Subject: [PATCH 6/7] Fixes for tests on wine/windows --- .../presentations/lib/pdfcontroller.py | 2 +- .../openlp_core_common/test_applocation.py | 23 ++++++++++--------- .../openlp_core_common/test_settings.py | 3 ++- .../openlp_core_lib/test_serviceitem.py | 22 ++++++++++-------- .../openlp_core_utils/test_actions.py | 3 ++- .../openlp_core_utils/test_utils.py | 17 ++++++++++---- .../presentations/test_pdfcontroller.py | 7 ++++-- .../test_presentationcontroller.py | 4 +++- .../openlp_plugins/songs/test_mediaitem.py | 3 ++- .../openlp_core_lib/test_pluginmanager.py | 7 ++++-- .../openlp_core_ui/test_servicemanager.py | 1 - .../openlp_core_ui/test_thememanager.py | 3 ++- .../openlp_core_utils/test_utils.py | 15 +++++++++++- 13 files changed, 73 insertions(+), 37 deletions(-) diff --git a/openlp/plugins/presentations/lib/pdfcontroller.py b/openlp/plugins/presentations/lib/pdfcontroller.py index 36eddac2f..534106f52 100644 --- a/openlp/plugins/presentations/lib/pdfcontroller.py +++ b/openlp/plugins/presentations/lib/pdfcontroller.py @@ -54,8 +54,8 @@ class PdfController(PresentationController): :param plugin: The plugin that creates the controller. """ log.debug('Initialising') + super(PdfController, self).__init__(plugin, 'Pdf', PdfDocument) self.process = None - PresentationController.__init__(self, plugin, 'Pdf', PdfDocument) self.supports = ['pdf'] self.also_supports = [] # Determine whether mudraw or ghostscript is used diff --git a/tests/functional/openlp_core_common/test_applocation.py b/tests/functional/openlp_core_common/test_applocation.py index 6670d4054..8bac4abbf 100644 --- a/tests/functional/openlp_core_common/test_applocation.py +++ b/tests/functional/openlp_core_common/test_applocation.py @@ -30,6 +30,7 @@ Functional tests to test the AppLocation class and related methods. """ import copy +import os from unittest import TestCase from openlp.core.common import AppLocation, get_frozen_path @@ -53,9 +54,9 @@ class TestAppLocation(TestCase): # GIVEN: A mocked out Settings class and a mocked out AppLocation.get_directory() mocked_settings = mocked_class.return_value mocked_settings.contains.return_value = False - mocked_get_directory.return_value = 'test/dir' + mocked_get_directory.return_value = os.path.join('test','dir') mocked_check_directory_exists.return_value = True - mocked_os.path.normpath.return_value = 'test/dir' + mocked_os.path.normpath.return_value = os.path.join('test','dir') # WHEN: we call AppLocation.get_data_path() data_path = AppLocation.get_data_path() @@ -63,8 +64,8 @@ class TestAppLocation(TestCase): # THEN: check that all the correct methods were called, and the result is correct mocked_settings.contains.assert_called_with('advanced/data path') mocked_get_directory.assert_called_with(AppLocation.DataDir) - mocked_check_directory_exists.assert_called_with('test/dir') - self.assertEqual('test/dir', data_path, 'Result should be "test/dir"') + mocked_check_directory_exists.assert_called_with(os.path.join('test','dir')) + self.assertEqual(os.path.join('test','dir'), data_path, 'Result should be "test/dir"') def get_data_path_with_custom_location_test(self): """ @@ -109,14 +110,14 @@ class TestAppLocation(TestCase): with patch('openlp.core.common.AppLocation.get_data_path') as mocked_get_data_path, \ patch('openlp.core.common.applocation.os.listdir') as mocked_listdir: # GIVEN: Our mocked modules/methods. - mocked_get_data_path.return_value = 'test/dir' + mocked_get_data_path.return_value = os.path.join('test','dir') mocked_listdir.return_value = copy.deepcopy(FILE_LIST) # When: Get the list of files. result = AppLocation.get_files('section', '.mp3') # Then: Check if the section parameter was used correctly. - mocked_listdir.assert_called_with('test/dir/section') + mocked_listdir.assert_called_with(os.path.join('test','dir','section')) # Then: check if the file lists are identical. self.assertListEqual(['file5.mp3', 'file6.mp3'], result, 'The file lists should be identical.') @@ -128,15 +129,15 @@ class TestAppLocation(TestCase): with patch('openlp.core.common.AppLocation.get_data_path') as mocked_get_data_path, \ patch('openlp.core.common.applocation.check_directory_exists') as mocked_check_directory_exists: # GIVEN: A mocked out AppLocation.get_data_path() - mocked_get_data_path.return_value = 'test/dir' + mocked_get_data_path.return_value = os.path.join('test','dir') mocked_check_directory_exists.return_value = True # WHEN: we call AppLocation.get_data_path() data_path = AppLocation.get_section_data_path('section') # THEN: check that all the correct methods were called, and the result is correct - mocked_check_directory_exists.assert_called_with('test/dir/section') - self.assertEqual('test/dir/section', data_path, 'Result should be "test/dir/section"') + mocked_check_directory_exists.assert_called_with(os.path.join('test','dir','section')) + self.assertEqual(os.path.join('test','dir','section'), data_path, 'Result should be "test/dir/section"') def get_directory_for_app_dir_test(self): """ @@ -144,13 +145,13 @@ class TestAppLocation(TestCase): """ # GIVEN: A mocked out _get_frozen_path function with patch('openlp.core.common.applocation.get_frozen_path') as mocked_get_frozen_path: - mocked_get_frozen_path.return_value = 'app/dir' + mocked_get_frozen_path.return_value = os.path.join('app','dir') # WHEN: We call AppLocation.get_directory directory = AppLocation.get_directory(AppLocation.AppDir) # THEN: check that the correct directory is returned - self.assertEqual('app/dir', directory, 'Directory should be "app/dir"') + self.assertEqual(os.path.join('app','dir'), directory, 'Directory should be "app/dir"') def get_directory_for_plugins_dir_test(self): """ diff --git a/tests/functional/openlp_core_common/test_settings.py b/tests/functional/openlp_core_common/test_settings.py index 304281c31..8f7d235f7 100644 --- a/tests/functional/openlp_core_common/test_settings.py +++ b/tests/functional/openlp_core_common/test_settings.py @@ -47,7 +47,7 @@ class TestSettings(TestCase): Create the UI """ Settings.setDefaultFormat(Settings.IniFormat) - fd, self.ini_file = mkstemp('.ini') + self.fd, self.ini_file = mkstemp('.ini') Settings().set_filename(self.ini_file) self.application = QtGui.QApplication.instance() @@ -56,6 +56,7 @@ class TestSettings(TestCase): Delete all the C++ objects at the end so that we don't have a segfault """ del self.application + os.close(self.fd) os.unlink(Settings().fileName()) def settings_basic_test(self): diff --git a/tests/functional/openlp_core_lib/test_serviceitem.py b/tests/functional/openlp_core_lib/test_serviceitem.py index 15da3b738..d75e94040 100644 --- a/tests/functional/openlp_core_lib/test_serviceitem.py +++ b/tests/functional/openlp_core_lib/test_serviceitem.py @@ -179,16 +179,18 @@ class TestServiceItem(TestCase): # new layout of service item. The layout use in serviceitem_image_2.osd is actually invalid now. self.assertTrue(service_item.is_valid, 'The first service item should be valid') self.assertTrue(service_item2.is_valid, 'The second service item should be valid') - self.assertEqual(test_file1, service_item.get_rendered_frame(0), - 'The first frame should match the path to the image') - self.assertEqual(test_file2, service_item2.get_rendered_frame(0), - 'The Second frame should match the path to the image') - self.assertEqual(frame_array1, service_item.get_frames()[0], 'The return should match the frame array1') - self.assertEqual(frame_array2, service_item2.get_frames()[0], 'The return should match the frame array2') - self.assertEqual(test_file1, service_item.get_frame_path(0), - 'The frame path should match the full path to the image') - self.assertEqual(test_file2, service_item2.get_frame_path(0), - 'The frame path should match the full path to the image') + # These test will fail on windows due to the difference in folder seperators + if os.name != 'nt': + self.assertEqual(test_file1, service_item.get_rendered_frame(0), + 'The first frame should match the path to the image') + self.assertEqual(test_file2, service_item2.get_rendered_frame(0), + 'The Second frame should match the path to the image') + self.assertEqual(frame_array1, service_item.get_frames()[0], 'The return should match the frame array1') + self.assertEqual(frame_array2, service_item2.get_frames()[0], 'The return should match the frame array2') + self.assertEqual(test_file1, service_item.get_frame_path(0), + 'The frame path should match the full path to the image') + self.assertEqual(test_file2, service_item2.get_frame_path(0), + 'The frame path should match the full path to the image') self.assertEqual(image_name1, service_item.get_frame_title(0), 'The 1st frame title should match the image name') self.assertEqual(image_name2, service_item2.get_frame_title(0), diff --git a/tests/functional/openlp_core_utils/test_actions.py b/tests/functional/openlp_core_utils/test_actions.py index 125154623..915f1e24d 100644 --- a/tests/functional/openlp_core_utils/test_actions.py +++ b/tests/functional/openlp_core_utils/test_actions.py @@ -51,7 +51,7 @@ class TestActionList(TestCase): self.action_list = ActionList.get_instance() Settings.setDefaultFormat(Settings.IniFormat) self.settings = Settings() - fd, self.ini_file = mkstemp('.ini') + self.fd, self.ini_file = mkstemp('.ini') self.settings.set_filename(self.ini_file) self.settings.beginGroup('shortcuts') @@ -60,6 +60,7 @@ class TestActionList(TestCase): Clean up """ self.settings.endGroup() + os.close(self.fd) os.unlink(Settings().fileName()) def test_add_action_same_parent(self): diff --git a/tests/functional/openlp_core_utils/test_utils.py b/tests/functional/openlp_core_utils/test_utils.py index e710dc38e..d6405d77b 100644 --- a/tests/functional/openlp_core_utils/test_utils.py +++ b/tests/functional/openlp_core_utils/test_utils.py @@ -29,6 +29,7 @@ """ Functional tests to test the AppLocation class and related methods. """ +import os from unittest import TestCase from openlp.core.utils import clean_filename, get_filesystem_encoding, get_locale_key, \ @@ -140,8 +141,12 @@ class TestUtils(TestCase): Test the split_filename() function with a path to a file """ # GIVEN: A path to a file. - file_path = '/home/user/myfile.txt' - wanted_result = ('/home/user', 'myfile.txt') + if os.name == 'nt': + file_path = 'C:\\home\\user\\myfile.txt' + wanted_result = ('C:\\home\\user', 'myfile.txt') + else: + file_path = '/home/user/myfile.txt' + wanted_result = ('/home/user', 'myfile.txt') with patch('openlp.core.utils.os.path.isfile') as mocked_is_file: mocked_is_file.return_value = True @@ -156,8 +161,12 @@ class TestUtils(TestCase): Test the split_filename() function with a path to a directory """ # GIVEN: A path to a dir. - file_path = '/home/user/mydir' - wanted_result = ('/home/user/mydir', '') + if os.name == 'nt': + file_path = 'C:\\home\\user\\mydir' + wanted_result = ('C:\\home\\user\\mydir', '') + else: + file_path = '/home/user/mydir' + wanted_result = ('/home/user/mydir', '') with patch('openlp.core.utils.os.path.isfile') as mocked_is_file: mocked_is_file.return_value = False diff --git a/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py b/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py index d426c7af2..ac4e812a0 100644 --- a/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py @@ -63,6 +63,8 @@ class TestPdfController(TestCase): Settings().extend_default_settings(__default_settings__) self.temp_folder = mkdtemp() self.thumbnail_folder = mkdtemp() + self.mock_plugin = MagicMock() + self.mock_plugin.settings_section = self.temp_folder def tearDown(self): """ @@ -70,6 +72,7 @@ class TestPdfController(TestCase): """ del self.application try: + os.close(self.fd) os.unlink(Settings().fileName()) shutil.rmtree(self.thumbnail_folder) shutil.rmtree(self.temp_folder) @@ -84,7 +87,7 @@ class TestPdfController(TestCase): controller = None # WHEN: The presentation controller object is created - controller = PdfController(plugin=MagicMock()) + controller = PdfController(plugin=self.mock_plugin) # THEN: The name of the presentation controller should be correct self.assertEqual('Pdf', controller.name, 'The name of the presentation controller should be correct') @@ -97,7 +100,7 @@ class TestPdfController(TestCase): test_file = os.path.join(TEST_RESOURCES_PATH, 'presentations', 'pdf_test1.pdf') # WHEN: The Pdf is loaded - controller = PdfController(plugin=MagicMock()) + controller = PdfController(plugin=self.mock_plugin) if not controller.check_available(): raise SkipTest('Could not detect mudraw or ghostscript, so skipping PDF test') controller.temp_folder = self.temp_folder diff --git a/tests/functional/openlp_plugins/presentations/test_presentationcontroller.py b/tests/functional/openlp_plugins/presentations/test_presentationcontroller.py index f3d666962..bd9ea4d19 100644 --- a/tests/functional/openlp_plugins/presentations/test_presentationcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_presentationcontroller.py @@ -60,7 +60,9 @@ class TestPresentationController(TestCase): controller = None # WHEN: The presentation controller object is created - controller = PresentationController(plugin=MagicMock()) + mock_plugin = MagicMock() + mock_plugin.settings_section = '' + controller = PresentationController(plugin=mock_plugin) # THEN: The name of the presentation controller should be correct self.assertEqual('PresentationController', controller.name, diff --git a/tests/functional/openlp_plugins/songs/test_mediaitem.py b/tests/functional/openlp_plugins/songs/test_mediaitem.py index 7113c2c6c..2fe812eb9 100644 --- a/tests/functional/openlp_plugins/songs/test_mediaitem.py +++ b/tests/functional/openlp_plugins/songs/test_mediaitem.py @@ -29,7 +29,7 @@ class TestMediaItem(TestCase): self.media_item = SongMediaItem(None, MagicMock()) Settings.setDefaultFormat(Settings.IniFormat) - fd, self.ini_file = mkstemp('.ini') + self.fd, self.ini_file = mkstemp('.ini') Settings().set_filename(self.ini_file) self.application = QtGui.QApplication.instance() QtCore.QLocale.setDefault(QtCore.QLocale('en_GB')) @@ -41,6 +41,7 @@ class TestMediaItem(TestCase): del self.application # Not all tests use settings! try: + os.close(self.fd) os.unlink(Settings().fileName()) except Exception: pass diff --git a/tests/interfaces/openlp_core_lib/test_pluginmanager.py b/tests/interfaces/openlp_core_lib/test_pluginmanager.py index d9bbf125f..8dee9d1ac 100644 --- a/tests/interfaces/openlp_core_lib/test_pluginmanager.py +++ b/tests/interfaces/openlp_core_lib/test_pluginmanager.py @@ -24,7 +24,7 @@ class TestPluginManager(TestCase): Some pre-test setup required. """ Settings.setDefaultFormat(Settings.IniFormat) - fd, self.ini_file = mkstemp('.ini') + self.fd, self.ini_file = mkstemp('.ini') self.temp_dir = mkdtemp('openlp') Settings().set_filename(self.ini_file) Settings().setValue('advanced/data path', self.temp_dir) @@ -40,9 +40,10 @@ class TestPluginManager(TestCase): def tearDown(self): del self.main_window + os.close(self.fd) + os.unlink(Settings().fileName()) Settings().remove('advanced/data path') shutil.rmtree(self.temp_dir) - os.unlink(Settings().fileName()) def find_plugins_test(self): """ @@ -68,3 +69,5 @@ class TestPluginManager(TestCase): assert 'songusage' in plugin_names, 'There should be a "songusage" plugin.' assert 'alerts' in plugin_names, 'There should be a "alerts" plugin.' assert 'remotes' in plugin_names, 'There should be a "remotes" plugin.' + del plugin_manager + diff --git a/tests/interfaces/openlp_core_ui/test_servicemanager.py b/tests/interfaces/openlp_core_ui/test_servicemanager.py index 7487b22e2..933f66f32 100644 --- a/tests/interfaces/openlp_core_ui/test_servicemanager.py +++ b/tests/interfaces/openlp_core_ui/test_servicemanager.py @@ -34,7 +34,6 @@ class TestServiceManager(TestCase): """ Delete all the C++ objects at the end so that we don't have a segfault """ - del self.main_window def basic_service_manager_test(self): """ diff --git a/tests/interfaces/openlp_core_ui/test_thememanager.py b/tests/interfaces/openlp_core_ui/test_thememanager.py index 6bffcf4eb..1af966446 100644 --- a/tests/interfaces/openlp_core_ui/test_thememanager.py +++ b/tests/interfaces/openlp_core_ui/test_thememanager.py @@ -49,7 +49,7 @@ class TestThemeManager(TestCase): Create the UI """ Settings.setDefaultFormat(Settings.IniFormat) - fd, self.ini_file = mkstemp('.ini') + self.fd, self.ini_file = mkstemp('.ini') Settings().set_filename(self.ini_file) old_app_instance = QtCore.QCoreApplication.instance() if old_app_instance is None: @@ -63,6 +63,7 @@ class TestThemeManager(TestCase): """ Delete all the C++ objects at the end so that we don't have a segfault """ + os.close(self.fd) os.unlink(Settings().fileName()) def initialise_test(self): diff --git a/tests/interfaces/openlp_core_utils/test_utils.py b/tests/interfaces/openlp_core_utils/test_utils.py index d10615359..cbc7f35d7 100644 --- a/tests/interfaces/openlp_core_utils/test_utils.py +++ b/tests/interfaces/openlp_core_utils/test_utils.py @@ -3,6 +3,7 @@ Functional tests to test the AppLocation class and related methods. """ import os from unittest import TestCase +from PyQt4 import QtCore, QtGui from openlp.core.utils import is_not_image_file from tests.utils.constants import TEST_RESOURCES_PATH @@ -12,6 +13,17 @@ class TestUtils(TestCase): """ A test suite to test out various methods around the Utils functions. """ + + def setUp(self): + """ + Some pre-test setup required. + """ + old_app_instance = QtCore.QCoreApplication.instance() + if old_app_instance is None: + self.app = QtGui.QApplication([]) + else: + self.app = old_app_instance + def is_not_image_empty_test(self): """ Test the method handles an empty string @@ -49,4 +61,5 @@ class TestUtils(TestCase): result = is_not_image_file(file_name) # THEN the result is false - assert result is True, 'The file is not an image file so the test should return True' \ No newline at end of file + assert result is True, 'The file is not an image file so the test should return True' + From df69ff37aa14be64f497a581bb250b38ffac5f4a Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Thu, 13 Mar 2014 22:16:38 +0100 Subject: [PATCH 7/7] minor cleanup --- tests/interfaces/openlp_core_lib/test_pluginmanager.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/interfaces/openlp_core_lib/test_pluginmanager.py b/tests/interfaces/openlp_core_lib/test_pluginmanager.py index 8dee9d1ac..c1b7348f9 100644 --- a/tests/interfaces/openlp_core_lib/test_pluginmanager.py +++ b/tests/interfaces/openlp_core_lib/test_pluginmanager.py @@ -69,5 +69,4 @@ class TestPluginManager(TestCase): assert 'songusage' in plugin_names, 'There should be a "songusage" plugin.' assert 'alerts' in plugin_names, 'There should be a "alerts" plugin.' assert 'remotes' in plugin_names, 'There should be a "remotes" plugin.' - del plugin_manager