forked from openlp/openlp
Fix tests
This commit is contained in:
parent
2868320d9d
commit
36fd65f98c
@ -456,10 +456,10 @@ class TestPluginManager(TestCase):
|
|||||||
mocked_plugin.name = 'Mocked Plugin'
|
mocked_plugin.name = 'Mocked Plugin'
|
||||||
plugin_manager = PluginManager()
|
plugin_manager = PluginManager()
|
||||||
Registry().register('mock_plugin', mocked_plugin)
|
Registry().register('mock_plugin', mocked_plugin)
|
||||||
|
|
||||||
# WHEN: We run finalise_plugins()
|
|
||||||
State().add_service("mock", 1, is_plugin=True, status=PluginStatus.Active)
|
State().add_service("mock", 1, is_plugin=True, status=PluginStatus.Active)
|
||||||
State().flush_preconditions()
|
State().flush_preconditions()
|
||||||
|
|
||||||
|
# WHEN: We run finalise_plugins()
|
||||||
result = plugin_manager.get_plugin_by_name('Mocked Plugin')
|
result = plugin_manager.get_plugin_by_name('Mocked Plugin')
|
||||||
|
|
||||||
# THEN: The is_active() and finalise() methods should have been called
|
# 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.status = PluginStatus.Disabled
|
||||||
mocked_plugin.is_active.return_value = False
|
mocked_plugin.is_active.return_value = False
|
||||||
plugin_manager = PluginManager()
|
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()
|
# WHEN: We run finalise_plugins()
|
||||||
plugin_manager.new_service_created()
|
plugin_manager.new_service_created()
|
||||||
@ -493,7 +495,9 @@ class TestPluginManager(TestCase):
|
|||||||
mocked_plugin.status = PluginStatus.Active
|
mocked_plugin.status = PluginStatus.Active
|
||||||
mocked_plugin.is_active.return_value = True
|
mocked_plugin.is_active.return_value = True
|
||||||
plugin_manager = PluginManager()
|
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()
|
# WHEN: We run new_service_created()
|
||||||
plugin_manager.new_service_created()
|
plugin_manager.new_service_created()
|
||||||
|
@ -220,7 +220,7 @@ class TestServiceItem(TestCase, TestMixin):
|
|||||||
'The Second frame should match the path to the image'
|
'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_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 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'
|
'The frame path should match the full path to the image'
|
||||||
assert test_file2 == service_item2.get_frame_path(0), \
|
assert test_file2 == service_item2.get_frame_path(0), \
|
||||||
'The frame path should match the full path to the image'
|
'The frame path should match the full path to the image'
|
||||||
|
Loading…
Reference in New Issue
Block a user