示例#1
0
 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()
示例#2
0
 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()
示例#3
0
 def test_get_plugin_conf_key(self):
     self.assertEqual(get_plugin_conf_key('Test'), 'TEST')
     self.assertEqual(get_plugin_conf_key('TestTwo'), 'TEST_TWO')
示例#4
0
 def test_get_plugin_conf_key(self):
     self.assertEqual(get_plugin_conf_key('Test'), 'TEST')
     self.assertEqual(get_plugin_conf_key('TestTwo'), 'TEST_TWO')