forked from openlp/openlp
- Added a test for checking that next calls the next playlist item
This commit is contained in:
parent
798f3738b8
commit
48c6810f0c
@ -99,7 +99,7 @@ from .themelayoutform import ThemeLayoutForm
|
|||||||
from .themeform import ThemeForm
|
from .themeform import ThemeForm
|
||||||
from .filerenameform import FileRenameForm
|
from .filerenameform import FileRenameForm
|
||||||
from .starttimeform import StartTimeForm
|
from .starttimeform import StartTimeForm
|
||||||
from .maindisplay import MainDisplay, Display
|
from .maindisplay import MainDisplay, Display, AudioPlayer
|
||||||
from .servicenoteform import ServiceNoteForm
|
from .servicenoteform import ServiceNoteForm
|
||||||
from .serviceitemeditform import ServiceItemEditForm
|
from .serviceitemeditform import ServiceItemEditForm
|
||||||
from .slidecontroller import SlideController, DisplayController, PreviewController, LiveController
|
from .slidecontroller import SlideController, DisplayController, PreviewController, LiveController
|
||||||
@ -120,8 +120,8 @@ from .projector.tab import ProjectorTab
|
|||||||
from .projector.editform import ProjectorEditForm
|
from .projector.editform import ProjectorEditForm
|
||||||
|
|
||||||
__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeForm',
|
__all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeForm',
|
||||||
'ThemeManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm',
|
'ThemeManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', 'Display', 'AudioPlayer',
|
||||||
'Display', 'ServiceNoteForm', 'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay',
|
'ServiceNoteForm', 'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay',
|
||||||
'SlideController', 'DisplayController', 'GeneralTab', 'ThemesTab', 'AdvancedTab', 'PluginForm',
|
'SlideController', 'DisplayController', 'GeneralTab', 'ThemesTab', 'AdvancedTab', 'PluginForm',
|
||||||
'FormattingTagForm', 'ShortcutListForm', 'FormattingTagController', 'SingleColumnTableWidget',
|
'FormattingTagForm', 'ShortcutListForm', 'FormattingTagController', 'SingleColumnTableWidget',
|
||||||
'ProjectorManager', 'ProjectorTab', 'ProjectorEditForm']
|
'ProjectorManager', 'ProjectorTab', 'ProjectorEditForm']
|
||||||
|
@ -29,7 +29,7 @@ from PyQt5 import QtCore
|
|||||||
|
|
||||||
from openlp.core.common import Registry, is_macosx, Settings
|
from openlp.core.common import Registry, is_macosx, Settings
|
||||||
from openlp.core.lib import ScreenList, PluginManager
|
from openlp.core.lib import ScreenList, PluginManager
|
||||||
from openlp.core.ui import MainDisplay
|
from openlp.core.ui import MainDisplay, AudioPlayer
|
||||||
from openlp.core.ui.media import MediaController
|
from openlp.core.ui.media import MediaController
|
||||||
from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET
|
from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET
|
||||||
|
|
||||||
@ -283,3 +283,18 @@ class TestMainDisplay(TestCase, TestMixin):
|
|||||||
self.assertEquals(main_display.web_view.setHtml.call_count, 1, 'setHTML should be called once')
|
self.assertEquals(main_display.web_view.setHtml.call_count, 1, 'setHTML should be called once')
|
||||||
self.assertEquals(main_display.media_controller.video.call_count, 1,
|
self.assertEquals(main_display.media_controller.video.call_count, 1,
|
||||||
'Media Controller video should have been called once')
|
'Media Controller video should have been called once')
|
||||||
|
|
||||||
|
|
||||||
|
def test_calling_next_item_in_playlist():
|
||||||
|
"""
|
||||||
|
Test the AudioPlayer.next() method
|
||||||
|
"""
|
||||||
|
# GIVEN: An instance of AudioPlayer with a mocked out playlist
|
||||||
|
audio_player = AudioPlayer(None)
|
||||||
|
|
||||||
|
# WHEN: next is called.
|
||||||
|
with patch.object(audio_player, 'playlist') as mocked_playlist:
|
||||||
|
audio_player.next()
|
||||||
|
|
||||||
|
# THEN: playlist.next should had been called once.
|
||||||
|
mocked_playlist.next.assert_called_once_with()
|
||||||
|
Loading…
Reference in New Issue
Block a user