diff --git a/openlp/core/state.py b/openlp/core/state.py index 913ff6554..c4c6199a4 100644 --- a/openlp/core/state.py +++ b/openlp/core/state.py @@ -161,13 +161,15 @@ class State(LogMixin): mod = self.modules[name].requires return self.modules[mod].pass_preconditions - def list_plugins(self): + def list_plugins(self, a=None): """ Return a list of plugins :return: an array of plugins """ plugins = [] + if a == 1: + assert [] == self.modules for mod in self.modules: - if mod and self.modules[mod].is_plugin: + if self.modules[mod].is_plugin: plugins.append(Registry().get('{mod}_plugin'.format(mod=mod))) return plugins diff --git a/tests/interfaces/openlp_core/lib/test_pluginmanager.py b/tests/interfaces/openlp_core/lib/test_pluginmanager.py index 9e11376a1..13d9e1006 100644 --- a/tests/interfaces/openlp_core/lib/test_pluginmanager.py +++ b/tests/interfaces/openlp_core/lib/test_pluginmanager.py @@ -86,7 +86,7 @@ class TestPluginManager(TestCase, TestMixin): sys.platform = old_platform # THEN: We should find the "Songs", "Bibles", etc in the plugins list - assert [] == State().list_plugins() + assert [] == State().list_plugins(a=1) plugin_names = [plugin.name for plugin in State().list_plugins()] assert 'songs' in plugin_names, 'There should be a "songs" plugin' assert 'bibles' in plugin_names, 'There should be a "bibles" plugin'