9a5a6d354a
Allow the user to provide aliases when loading a module multiple times so that the modules can be differentiated (e.g. for passing parameters to a module). see #23
28 lines
927 B
Python
28 lines
927 B
Python
import unittest
|
|
|
|
from bumblebee.config import Config
|
|
|
|
class TestConfig(unittest.TestCase):
|
|
def setUp(self):
|
|
self.defaultConfig = Config()
|
|
self.someSimpleModules = [ "foo", "bar", "baz" ]
|
|
self.someAliasModules = [ "foo:a", "bar:b", "baz:c" ]
|
|
|
|
|
|
def test_no_modules_by_default(self):
|
|
self.assertEquals(self.defaultConfig.modules(), [])
|
|
|
|
def test_load_simple_modules(self):
|
|
cfg = Config([ "-m" ] + self.someSimpleModules)
|
|
self.assertEquals(cfg.modules(), list(map(lambda x: {
|
|
"name": x, "module": x
|
|
}, self.someSimpleModules)))
|
|
|
|
def test_load_alias_modules(self):
|
|
cfg = Config([ "-m" ] + self.someAliasModules)
|
|
self.assertEquals(cfg.modules(), list(map(lambda x: {
|
|
"module": x.split(":")[0],
|
|
"name": x.split(":")[1]
|
|
}, self.someAliasModules)))
|
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|