Exemple #1
0
def test_list_plugins(plugins):
    client = Mock()
    plugins.all_plugins = set(['plugin1', 'plugin2', 'plugin3'])
    plugins.enabled_plugins = {'foo': set(['plugin2'])}

    resp = manager.list_plugins(client, 'foo')
    assert 'Plugins enabled on this channel: plugin2' in resp
    assert 'Available plugins: plugin1, plugin3' in resp
Exemple #2
0
def test_list_plugins(plugins):
    client = Mock()
    plugins.all_plugins = set(['plugin1', 'plugin2', 'plugin3'])
    plugins.enabled_plugins = {'foo': set(['plugin2'])}

    resp = manager.list_plugins(client, 'foo')
    assert 'Plugins enabled on this channel: plugin2' in resp
    assert 'Available plugins: plugin1, plugin3' in resp
Exemple #3
0
def test_list_plugins_handles_unicode(plugins):
    client = Mock()
    snowman = u'☃'
    poo = u'💩'

    plugins.all_plugins = set([snowman, poo])
    plugins.enabled_plugins = {'foo': set([poo])}

    resp = manager.list_plugins(client, 'foo')
    assert u'Plugins enabled on this channel: {0}'.format(poo) in resp
    assert u'Available plugins: {0}'.format(snowman) in resp
Exemple #4
0
def test_list_plugins_handles_unicode(plugins):
    client = Mock()
    snowman = u'☃'
    poo = u'💩'

    plugins.all_plugins = set([snowman, poo])
    plugins.enabled_plugins = {'foo': set([poo])}

    resp = manager.list_plugins(client, 'foo')
    assert u'Plugins enabled on this channel: {0}'.format(poo) in resp
    assert u'Available plugins: {0}'.format(snowman) in resp
Exemple #5
0
def test_list_plugins(plugins):
    client = Mock()
    plugins.plugins = {
        'plugin1': [1, 2, 3],
        'plugin2': [4, 5, 6],
        'plugin3': [7, 8, 9],
    }
    plugins.all_plugins = set(plugins.plugins.keys())
    plugins.enabled_plugins = {'foo': set(['plugin2'])}

    resp = manager.list_plugins(client, 'foo')
    assert 'Plugins enabled on this channel: plugin2' in resp
    assert 'Available plugins: plugin1, plugin3' in resp