Пример #1
0
 def test_star(self, init_plugins_mock):
     plugindir = 'test/plugindir'
     server = Mock()
     server.config = {'pluginpath': plugindir}
     ret = on_message({"text": u"!enable *"}, server)
     assert ret == "enabling all plugins"
     init_plugins_mock.assert_called_with(plugindir, None)
Пример #2
0
 def test_basic(self, init_plugins_mock):
     plugindir = 'test/plugindir'
     server = Mock()
     server.config = {'pluginpath': plugindir}
     ret = on_message({"text": u"!enable help,enable"}, server)
     assert ret == "enabling plugins: help,enable"
     init_plugins_mock.assert_called_with(plugindir, ['enable', 'help'])
Пример #3
0
 def test_enable_missing(self, init_plugins_mock):
     plugindir = 'test/plugindir'
     server = Mock()
     server.config = {'pluginpath': plugindir}
     ret = on_message({"text": u"!enable dog,help,dog"}, server)
     assert ret == "enabling plugins: dog,help,dog"
     init_plugins_mock.assert_called_with(plugindir,
                                          ['dog', 'enable', 'help'])