diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 1b71229b5..2b8383755 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -99,7 +99,7 @@ from .themelayoutform import ThemeLayoutForm from .themeform import ThemeForm from .filerenameform import FileRenameForm from .starttimeform import StartTimeForm -from .maindisplay import MainDisplay, Display +from .maindisplay import MainDisplay, Display, AudioPlayer from .servicenoteform import ServiceNoteForm from .serviceitemeditform import ServiceItemEditForm from .slidecontroller import SlideController, DisplayController, PreviewController, LiveController @@ -120,8 +120,8 @@ from .projector.tab import ProjectorTab from .projector.editform import ProjectorEditForm __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeForm', - 'ThemeManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', - 'Display', 'ServiceNoteForm', 'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay', + 'ThemeManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', 'Display', 'AudioPlayer', + 'ServiceNoteForm', 'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay', 'SlideController', 'DisplayController', 'GeneralTab', 'ThemesTab', 'AdvancedTab', 'PluginForm', 'FormattingTagForm', 'ShortcutListForm', 'FormattingTagController', 'SingleColumnTableWidget', 'ProjectorManager', 'ProjectorTab', 'ProjectorEditForm'] diff --git a/tests/functional/openlp_core_ui/test_maindisplay.py b/tests/functional/openlp_core_ui/test_maindisplay.py index 86aaf5ea7..e9ec825d2 100644 --- a/tests/functional/openlp_core_ui/test_maindisplay.py +++ b/tests/functional/openlp_core_ui/test_maindisplay.py @@ -29,7 +29,7 @@ from PyQt5 import QtCore from openlp.core.common import Registry, is_macosx, Settings 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.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.media_controller.video.call_count, 1, '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()