forked from openlp/openlp
fixes
This commit is contained in:
parent
9027e92e0f
commit
7f799b09d2
@ -76,6 +76,7 @@ class TestPluginManager(TestCase, TestMixin):
|
|||||||
"""
|
"""
|
||||||
# GIVEN: A plugin manager
|
# GIVEN: A plugin manager
|
||||||
plugin_manager = PluginManager()
|
plugin_manager = PluginManager()
|
||||||
|
plugin_manager.bootstrap_initialise()
|
||||||
|
|
||||||
# WHEN: We mock out sys.platform to make it return "darwin" and then find the plugins
|
# WHEN: We mock out sys.platform to make it return "darwin" and then find the plugins
|
||||||
old_platform = sys.platform
|
old_platform = sys.platform
|
||||||
|
@ -25,7 +25,11 @@ Package to test the openlp.core.ui.mainwindow package.
|
|||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
from PyQt5 import QtGui
|
||||||
|
|
||||||
|
from openlp.core.state import State
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
|
from openlp.core.lib.plugin import PluginStatus
|
||||||
from openlp.core.ui.mainwindow import MainWindow
|
from openlp.core.ui.mainwindow import MainWindow
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
@ -45,6 +49,11 @@ class TestMainWindow(TestCase, TestMixin):
|
|||||||
self.app.args = []
|
self.app.args = []
|
||||||
Registry().register('application', self.app)
|
Registry().register('application', self.app)
|
||||||
Registry().set_flag('no_web_server', True)
|
Registry().set_flag('no_web_server', True)
|
||||||
|
mocked_plugin = MagicMock()
|
||||||
|
mocked_plugin.status = PluginStatus.Active
|
||||||
|
mocked_plugin.icon = QtGui.QIcon()
|
||||||
|
Registry().register('mock_plugin', mocked_plugin)
|
||||||
|
State().add_service("mock", 1, is_plugin=True, status=PluginStatus.Active)
|
||||||
# Mock classes and methods used by mainwindow.
|
# Mock classes and methods used by mainwindow.
|
||||||
with patch('openlp.core.ui.mainwindow.SettingsForm'), \
|
with patch('openlp.core.ui.mainwindow.SettingsForm'), \
|
||||||
patch('openlp.core.ui.mainwindow.OpenLPDockWidget'), \
|
patch('openlp.core.ui.mainwindow.OpenLPDockWidget'), \
|
||||||
|
Loading…
Reference in New Issue
Block a user