Beispiel #1
0
def runtest():

    fakeDomoticz.Start()

    plugin = BasePlugin()
    plugin.onStart()
    # plugin.onCommand(1, '', '', '')
    plugin.onHeartbeat()
    plugin.onHeartbeat()
    plugin.onStop()
    def setUp(self):
        # work around logger
        self.stream_handler = logging.StreamHandler(sys.stdout)
        logger.addHandler(self.stream_handler)
        logging.getLogger().info("# set up test for dwd")
        self.plugin = BasePlugin() #plugin()

        config = configparser.ConfigParser()
        config.read_file(codecs.open(r"./test/my_config.ini", encoding="utf-8"))
        self.dwd = self.readAndCreate(config, CONFIG_SECTION_MY)

        self.plugin.dwd = self.dwd
 def createPlugin(self):
     plugin = BasePlugin()  #plugin()
     config = configparser.ConfigParser()
     config.read_file(codecs.open(r"./test/my_config.ini",
                                  encoding="utf-8"))
     self.assertTrue(
         config.has_section(CONFIG_SECTION),
         "we need this config to connect to fritzBox",
     )
     Parameters["Mode1"] = config.get(CONFIG_SECTION, "ip")
     Parameters["Username"] = config.get(CONFIG_SECTION, "user")
     Parameters["Password"] = config.get(CONFIG_SECTION, "pw")
     Parameters["Mode5"] = None
     Parameters["Mode6"] = 'Debug'
     return plugin