Fix tests

This commit is contained in:
Tim Bentley 2018-12-11 20:52:17 +00:00
parent 2868320d9d
commit 36fd65f98c
2 changed files with 9 additions and 5 deletions

View File

@ -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()

View File

@ -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'