コード例 #1
0
ファイル: test_adv.py プロジェクト: kbsmith97/big-brother-bot
    def init_plugin(self, config_content=None):
        conf = None
        if config_content:
            conf = XmlConfigParser()
            conf.setXml(config_content)
        elif default_plugin_content:
            conf = XmlConfigParser()
            conf.setXml(default_plugin_content)
        else:
            unittest.skip("cannot get default plugin config file at %s" % default_plugin_file)

        self.p = AdvPlugin(self.console, conf)
        self.p.save = Mock()
        self.conf = self.p.config
        self.log.setLevel(logging.DEBUG)
        self.log.info("============================= Adv plugin: loading config ============================")
        self.p.onLoadConfig()
        self.log.info("============================= Adv plugin: starting  =================================")
        self.p.onStartup()
コード例 #2
0
    def init_plugin(self, config_content=None):
        conf = None
        if config_content:
            conf = CfgConfigParser()
            conf.loadFromString(config_content)
        elif ADV_CONFIG_CONTENT:
            conf = CfgConfigParser()
            conf.loadFromString(ADV_CONFIG_CONTENT)
        else:
            unittest.skip("cannot get default plugin config file at %s" %
                          ADV_CONFIG_FILE)

        self.p = AdvPlugin(self.console, conf)
        self.p.save = Mock()
        self.conf = self.p.config
        self.log.setLevel(logging.DEBUG)
        self.log.info(
            "============================= Adv plugin: loading config ============================"
        )
        self.p.onLoadConfig()
        self.log.info(
            "============================= Adv plugin: starting  ================================="
        )
        self.p.onStartup()