def test_dynamic_load_library_no_action(mock_import): test_plugin = 'test plugin' manager = PluginManager(test_plugin) plugin_info = make_me_a_plugin_info(test_plugin) plugin_info.cls = object() manager.dynamic_load_library(plugin_info) assert mock_import.called is False
def test_dynamic_load_library(mock_import): test_plugin = 'test plugin' custom_obj = object() mock_import.return_value = custom_obj manager = PluginManager(test_plugin) plugin_info = make_me_a_plugin_info(test_plugin) manager.dynamic_load_library(plugin_info) eq_(custom_obj, plugin_info.cls)