def __init__(self, protocol, conf): self.protocol = protocol self.conf = conf conf_key = self.conf_key or get_plugin_conf_key(self.__class__.__name__) defaults = self.default_confs or {} required = self.required_confs or () self.plugin_conf = self.conf.get_sub_conf(conf_key, **defaults) self.plugin_conf.ensure(*required) self.post_init()
def __init__(self, protocol, conf): self.protocol = protocol self.conf = conf conf_key = self.conf_key or get_plugin_conf_key( self.__class__.__name__) defaults = self.default_confs or {} required = self.required_confs or () self.plugin_conf = self.conf.get_sub_conf(conf_key, **defaults) self.plugin_conf.ensure(*required) self.post_init()
def test_get_plugin_conf_key(self): self.assertEqual(get_plugin_conf_key('Test'), 'TEST') self.assertEqual(get_plugin_conf_key('TestTwo'), 'TEST_TWO')