diff --git a/.moban.yaml b/.moban.yaml index c30c142d..9be26c33 100644 --- a/.moban.yaml +++ b/.moban.yaml @@ -4,7 +4,7 @@ name: corobo dependencies: - pyopenssl - - git+https://github.com/errbotio/errbot@c2639879d4c298933cdf406193de5a5e626db12b + - git+https://github.com/errbotio/errbot@a0f35732484c8c0692e123c48653517cffa21a42 - wolframalpha - github3.py~=1.0.0 - IGitt==0.4.1.dev20180317153318 diff --git a/plugins/git_stats.plug b/plugins/git_stats.plug index 5a09b7f5..fdf690ab 100644 --- a/plugins/git_stats.plug +++ b/plugins/git_stats.plug @@ -1,5 +1,5 @@ [Core] -name = git_stats +name = GitStats module = git_stats [Documentation] diff --git a/requirements.txt b/requirements.txt index 81844e1d..a7ba6735 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ pyopenssl -git+https://github.com/errbotio/errbot@c2639879d4c298933cdf406193de5a5e626db12b +git+https://github.com/errbotio/errbot@a0f35732484c8c0692e123c48653517cffa21a42 wolframalpha github3.py~=1.0.0 IGitt==0.4.1.dev20180317153318 diff --git a/tests/helper.py b/tests/helper.py index e6419f4d..b00db3b0 100644 --- a/tests/helper.py +++ b/tests/helper.py @@ -1,9 +1,21 @@ from errbot.backends.test import TestBot +from errbot.plugin_info import PluginInfo +from errbot.templating import add_plugin_templates_path +from pathlib import Path def plugin_testbot(klass, loglevel, config=None): config = config if config else dict() testbot = TestBot(loglevel=loglevel, extra_config=config) testbot.start() - plug = testbot.bot.plugin_manager.instanciateElement(klass) + plugin_name = klass.__name__ + plug = klass(testbot.bot, plugin_name) return plug, testbot + + +def load_templates(plug_file_name): + plugin_info_path = (Path(__file__) + .parent / '..' / 'plugins' / plug_file_name) + with plugin_info_path.open() as plugfile: + plugin_info = PluginInfo.load_file(plugfile, plugin_info_path) + add_plugin_templates_path(plugin_info) diff --git a/tests/labhub_test.py b/tests/labhub_test.py index b4d982d6..446f5ffd 100644 --- a/tests/labhub_test.py +++ b/tests/labhub_test.py @@ -16,12 +16,13 @@ import plugins.labhub from plugins.labhub import LabHub -from tests.helper import plugin_testbot +from tests.helper import load_templates, plugin_testbot class TestLabHub(unittest.TestCase): def setUp(self): + load_templates('labhub.plug') plugins.labhub.github3 = create_autospec(github3) self.mock_org = create_autospec(github3.orgs.Organization)