Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

Commit

Permalink
Moved comment to docstring, fixed imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Romansky committed Nov 19, 2014
1 parent 3593fe1 commit 2f5b78c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/freeseer/tests/framework/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
import sys

from freeseer.framework.config.profile import ProfileManager
from freeseer.framework.plugin import PluginManager, IAudioInput
from freeseer.framework.plugin import IAudioInput
from freeseer.framework.plugin import PluginManager
from freeseer.framework.config import Config, options


Expand Down Expand Up @@ -258,17 +259,17 @@ class TestFakePlugin(IAudioInput):
def test_load_plugin_config(plugin_manager):
"""
Test that if a plugin sets a CONFIG_CLASS attribute then the configuration can be loaded.
- Verifies that PluginManager.load_plugin_config() returns a configuration when a CONFIG_CLASS is present and that
the load_plugin_config() method does not set the plugin_object.config attribute.
- Verifies that IBackendPlugin.load_config() sets a plugin_object.config attribute when a CONFIG_CLASS is specified
"""
plugins = plugin_manager.get_all_plugins()
for plugin in plugins:
if plugin.plugin_object.CONFIG_CLASS:
# Assert a configuration is returned
assert plugin_manager.load_plugin_config(plugin.plugin_object.CONFIG_CLASS, plugin.plugin_object.get_section_name())
# load_plugin_config should not actually set the plugin_object.config attribute
assert not hasattr(plugin.plugin_object, 'config')
# load the config and set plugin_object.config
plugin.plugin_object.load_config(plugin_manager)
# Assert that load_config set the plugin_object.config to a non-empty object
assert plugin.plugin_object.config
else:
assert not plugin_manager.load_plugin_config(plugin.plugin_object.CONFIG_CLASS, plugin.plugin_object.get_section_name())
Expand Down

0 comments on commit 2f5b78c

Please sign in to comment.