diff --git a/tests/functional/openlp_core/api/endpoint/test_controller.py b/tests/functional/openlp_core/api/endpoint/test_controller.py index 2d9bf3307..4f8346a83 100644 --- a/tests/functional/openlp_core/api/endpoint/test_controller.py +++ b/tests/functional/openlp_core/api/endpoint/test_controller.py @@ -24,6 +24,7 @@ from unittest.mock import MagicMock from PyQt5 import QtCore +from openlp.core.state import State from openlp.core.common.registry import Registry from openlp.core.api.endpoint.controller import controller_text, controller_direction from openlp.core.display.renderer import Renderer @@ -83,6 +84,9 @@ 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().add_service("media", 0) + State().update_pre_conditions("media", True) + State().flush_preconditions() self.mocked_live_controller.service_item.set_from_service(line) self.mocked_live_controller.service_item.render(True) # WHEN: I trigger the method diff --git a/tests/functional/openlp_core/common/test_registry.py b/tests/functional/openlp_core/common/test_registry.py index b5cf106b2..390b94bed 100644 --- a/tests/functional/openlp_core/common/test_registry.py +++ b/tests/functional/openlp_core/common/test_registry.py @@ -184,4 +184,4 @@ class TestRegistryBase(TestCase): RegistryStub() # THEN: The bootstrap methods should be registered - assert len(Registry().functions_list) == 2, 'The bootstrap functions should be in the dict.' + assert len(Registry().functions_list) == 3, 'The bootstrap functions should be in the dict.' diff --git a/tests/functional/openlp_core/lib/test_mediamanageritem.py b/tests/functional/openlp_core/lib/test_mediamanageritem.py index 7acc46146..cec0dc84e 100644 --- a/tests/functional/openlp_core/lib/test_mediamanageritem.py +++ b/tests/functional/openlp_core/lib/test_mediamanageritem.py @@ -85,6 +85,9 @@ class TestMediaManagerItem(TestCase, TestMixin): mocked_settings.value.side_effect = lambda x: x == 'advanced/double click live' MockedSettings.return_value = mocked_settings mmi = MediaManagerItem(None) + mmi.can_preview = True + mmi.can_make_live = True + mmi.can_add_to_service = True # WHEN: on_double_clicked() is called mmi.on_double_clicked() @@ -105,6 +108,9 @@ class TestMediaManagerItem(TestCase, TestMixin): mocked_settings.value.side_effect = lambda x: x == 'advanced/single click preview' MockedSettings.return_value = mocked_settings mmi = MediaManagerItem(None) + mmi.can_preview = True + mmi.can_make_live = True + mmi.can_add_to_service = True # WHEN: on_double_clicked() is called mmi.on_double_clicked() diff --git a/tests/functional/openlp_core/test_state.py b/tests/functional/openlp_core/test_state.py index 5e326b32d..8c3b68530 100644 --- a/tests/functional/openlp_core/test_state.py +++ b/tests/functional/openlp_core/test_state.py @@ -74,7 +74,7 @@ class TestState(TestCase, TestMixin): State().add_service("test1", 1, PluginStatus.Active, "test") State().add_service("test1", 1, PluginStatus.Active, "test") - # THEN I have a single saved service and one dependancy + # THEN I have a single saved service and one dependency assert len(State().modules) == 2 assert len(State().modules['test'].required_by) == 1