Fix a few tests.

This commit is contained in:
Tomas Groth 2019-02-06 21:26:33 +01:00
parent 4ea2578cff
commit 2e93377cd3
3 changed files with 5 additions and 3 deletions

View File

@ -1405,7 +1405,7 @@ class SlideController(QtWidgets.QWidget, LogMixin, RegistryProperties):
self.media_controller.video(self.controller_type, item, self.hide_mode())
if not self.is_live:
self.preview_display.show()
self.slide_preview.hide()
#self.slide_preview.hide()
def on_media_close(self):
"""
@ -1413,7 +1413,7 @@ class SlideController(QtWidgets.QWidget, LogMixin, RegistryProperties):
"""
self.media_controller.media_reset(self)
self.preview_display.hide()
self.slide_preview.show()
#self.slide_preview.show()
def _reset_blank(self, no_theme):
"""

View File

@ -93,6 +93,7 @@ class TestController(TestCase):
# GIVEN: A mocked service with a dummy service item
line = convert_file_service_item(TEST_PATH, 'serviceitem_custom_1.osj')
self.mocked_live_controller.service_item = ServiceItem(None)
State().load_settings()
State().add_service("media", 0)
State().update_pre_conditions("media", True)
State().flush_preconditions()

View File

@ -70,13 +70,14 @@ class TestMainWindow(TestCase, TestMixin):
self.add_toolbar_action_patcher = patch('openlp.core.ui.mainwindow.create_action')
self.mocked_add_toolbar_action = self.add_toolbar_action_patcher.start()
self.mocked_add_toolbar_action.side_effect = self._create_mock_action
self.renderer_patcher = patch('openlp.core.ui.mainwindow.Renderer')
self.renderer_patcher = patch('openlp.core.display.render.Renderer')
self.mocked_renderer = self.renderer_patcher.start()
mocked_desktop = MagicMock()
mocked_desktop.screenCount.return_value = 1
mocked_desktop.screenGeometry.return_value = QtCore.QRect(0, 0, 1024, 768)
mocked_desktop.primaryScreen.return_value = 1
ScreenList.create(mocked_desktop)
State().load_settings()
self.main_window = MainWindow()
def tearDown(self):