diff --git a/bumblebee/modules/test.py b/bumblebee/modules/test.py index 5e92e0e..e4099c6 100644 --- a/bumblebee/modules/test.py +++ b/bumblebee/modules/test.py @@ -5,6 +5,8 @@ import bumblebee.engine +ALIASES = [ "test-alias" ] + class Module(bumblebee.engine.Module): def __init__(self, engine, config): super(Module, self).__init__(engine, config, diff --git a/tests/test_engine.py b/tests/test_engine.py index 5623bbf..fe3f213 100644 --- a/tests/test_engine.py +++ b/tests/test_engine.py @@ -13,8 +13,10 @@ from mocks import MockOutput, MockInput class TestEngine(unittest.TestCase): def setUp(self): self.engine = Engine(config=Config(), output=MockOutput(), inp=MockInput()) - self.singleWidgetModule = [{"module": "test", "name": "a"}] self.testModule = "test" + self.testAlias = "test-alias" + self.singleWidgetModule = [{"module": self.testModule, "name": "a"}] + self.singleWidgetAlias = [{"module": self.testAlias, "name": "a" }] self.invalidModule = "no-such-module" self.testModuleSpec = "bumblebee.modules.{}".format(self.testModule) self.testModules = [ @@ -54,6 +56,11 @@ class TestEngine(unittest.TestCase): except Exception as e: self.fail(e) + def test_aliases(self): + modules = self.engine.load_modules(self.singleWidgetAlias) + self.assertEquals(len(modules), 1) + self.assertEquals(modules[0].__module__, self.testModuleSpec) + def test_custom_cmd(self): testmodules = [ { "name": "test", "button": "test.left-click", "action": "echo" },