try again

This commit is contained in:
Tim Bentley 2019-01-04 18:11:15 +00:00
parent f0108d89fc
commit 72cd432f10
2 changed files with 5 additions and 3 deletions

View File

@ -161,13 +161,15 @@ class State(LogMixin):
mod = self.modules[name].requires mod = self.modules[name].requires
return self.modules[mod].pass_preconditions return self.modules[mod].pass_preconditions
def list_plugins(self): def list_plugins(self, a=None):
""" """
Return a list of plugins Return a list of plugins
:return: an array of plugins :return: an array of plugins
""" """
plugins = [] plugins = []
if a == 1:
assert [] == self.modules
for mod in 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))) plugins.append(Registry().get('{mod}_plugin'.format(mod=mod)))
return plugins return plugins

View File

@ -86,7 +86,7 @@ class TestPluginManager(TestCase, TestMixin):
sys.platform = old_platform sys.platform = old_platform
# THEN: We should find the "Songs", "Bibles", etc in the plugins list # 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()] plugin_names = [plugin.name for plugin in State().list_plugins()]
assert 'songs' in plugin_names, 'There should be a "songs" plugin' assert 'songs' in plugin_names, 'There should be a "songs" plugin'
assert 'bibles' in plugin_names, 'There should be a "bibles" plugin' assert 'bibles' in plugin_names, 'There should be a "bibles" plugin'