From 36fd65f98c3c714affab87de7889e0041a9d835c Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 11 Dec 2018 20:52:17 +0000 Subject: [PATCH] Fix tests --- .../functional/openlp_core/lib/test_pluginmanager.py | 12 ++++++++---- tests/functional/openlp_core/lib/test_serviceitem.py | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/functional/openlp_core/lib/test_pluginmanager.py b/tests/functional/openlp_core/lib/test_pluginmanager.py index e1f654a7e..b4f5bc229 100644 --- a/tests/functional/openlp_core/lib/test_pluginmanager.py +++ b/tests/functional/openlp_core/lib/test_pluginmanager.py @@ -456,10 +456,10 @@ class TestPluginManager(TestCase): mocked_plugin.name = 'Mocked Plugin' plugin_manager = PluginManager() Registry().register('mock_plugin', mocked_plugin) - - # WHEN: We run finalise_plugins() State().add_service("mock", 1, is_plugin=True, status=PluginStatus.Active) State().flush_preconditions() + + # WHEN: We run finalise_plugins() result = plugin_manager.get_plugin_by_name('Mocked Plugin') # THEN: The is_active() and finalise() methods should have been called @@ -474,7 +474,9 @@ class TestPluginManager(TestCase): mocked_plugin.status = PluginStatus.Disabled mocked_plugin.is_active.return_value = False plugin_manager = PluginManager() - plugin_manager.plugins = [mocked_plugin] + Registry().register('mock_plugin', mocked_plugin) + State().add_service("mock", 1, is_plugin=True, status=PluginStatus.Active) + State().flush_preconditions() # WHEN: We run finalise_plugins() plugin_manager.new_service_created() @@ -493,7 +495,9 @@ class TestPluginManager(TestCase): mocked_plugin.status = PluginStatus.Active mocked_plugin.is_active.return_value = True plugin_manager = PluginManager() - plugin_manager.plugins = [mocked_plugin] + Registry().register('mock_plugin', mocked_plugin) + State().add_service("mock", 1, is_plugin=True, status=PluginStatus.Active) + State().flush_preconditions() # WHEN: We run new_service_created() plugin_manager.new_service_created() diff --git a/tests/functional/openlp_core/lib/test_serviceitem.py b/tests/functional/openlp_core/lib/test_serviceitem.py index 0f848fe2f..2aaa887bb 100644 --- a/tests/functional/openlp_core/lib/test_serviceitem.py +++ b/tests/functional/openlp_core/lib/test_serviceitem.py @@ -220,7 +220,7 @@ class TestServiceItem(TestCase, TestMixin): 'The Second frame should match the path to the image' assert frame_array1 == service_item.get_frames()[0], 'The return should match the frame array1' assert frame_array2 == service_item2.get_frames()[0], 'The return should match the frame array2' - assert test_file1 == service_item.get_frame_path(0), \ + assert test_file1 == str(service_item.get_frame_path(0)), \ 'The frame path should match the full path to the image' assert test_file2 == service_item2.get_frame_path(0), \ 'The frame path should match the full path to the image'