'The output manager implements ignore_plugins to avoid sending a
message to a specific plugin. Test this feature.'

def test_ignore_plugins(self):

    msg = 'foo    bar    spam    eggs'
    action = 'information'
    plugin = Mock()
    plugin_action = MagicMock()
    plugin_get_name = MagicMock(return_value='fake')
    setattr(plugin, action, plugin_action)
    setattr(plugin, 'get_name', plugin_get_name)
    om.manager._output_plugin_instances = [plugin]
    om_action = getattr(om.out, action)
    om_action(msg, False, ignore_plugins=set(['fake']))
    om_action(msg, False)
    om.manager.process_all_messages()
    plugin_action.assert_called_once_with(msg, False)
