Mock out AudioPlayer to avoid loading Phonon during test.

This commit is contained in:
Tomas Groth 2015-01-16 14:51:38 +01:00
parent 1efc145cdf
commit 76b47019b6
1 changed files with 4 additions and 1 deletions

View File

@ -39,7 +39,7 @@ from openlp.core.ui import MainDisplay
from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET
from tests.helpers.testmixin import TestMixin
from tests.functional import MagicMock
from tests.functional import MagicMock, patch
SCREEN = {
'primary': False,
@ -64,11 +64,14 @@ class TestMainDisplay(TestCase, TestMixin):
self.registry = Registry()
self.setup_application()
Registry().register('application', self.app)
self.mocked_audio_player = patch('openlp.core.ui.maindisplay.AudioPlayer')
self.mocked_audio_player.start()
def tearDown(self):
"""
Delete QApplication.
"""
self.mocked_audio_player.stop()
del self.screens
def initial_main_display_test(self):