diff --git a/tests/functional/openlp_plugins/presentations/test_messagelistener.py b/tests/functional/openlp_plugins/presentations/test_messagelistener.py index e4e85e29f..0997f643a 100644 --- a/tests/functional/openlp_plugins/presentations/test_messagelistener.py +++ b/tests/functional/openlp_plugins/presentations/test_messagelistener.py @@ -104,3 +104,23 @@ class TestMessageListener(TestCase, TestMixin): # THEN: The controllers will be setup. self.assertTrue(len(controllers), 'We have loaded a controller') + + @patch('openlp.plugins.presentations.lib.mediaitem.MessageListener._setup') + def start_pdf_presentation_test(self, media_mock): + """ + Test the startup of pdf presentation succeed. + """ + # GIVEN: A sservice item with a pdf + mock_item = MagicMock() + mock_item.processor = 'Pdf' + mock_item.get_frame_path.return_value = "test.pdf" + self.media_item.generate_slide_data = MagicMock() + ml = MessageListener(self.media_item) + ml.media_item = self.media_item + ml.preview_handler = MagicMock() + + # WHEN: request the presentation to start + ml.startup([mock_item, False, False, False]) + + # THEN: The handler should be set to None + self.assertIsNone(ml.handler, 'The handler should be None')