msg.set_type("xpl-cmnd") # msg.set_header(source ="domogik-{0}.{1}".format(self.name, get_sanitized_hostname())) msg.set_schema("irtrans.basic") msg.add_data(data) print(u"send fake xpl cmd switch on : {0}".format(msg)) xpl_plugin.myxpl.send(msg) if __name__ == "__main__": ### configuration # set up the xpl features xpl_plugin = XplPlugin(name='testirtr', daemonize=False, parser=None, nohub=True, test=True) # set test plugin ready for manager th = threading.Thread(None, xpl_plugin.ready, "plugin_test_ready") th.start() # set up the plugin name name = "irtrans" # set up the configuration of the plugin # configuration is done in test_0010_configure_the_plugin with the cfg content # notice that the old configuration is deleted before cfg = {'configured': True} ### start tests
def test_670_add_bad_alarm(self): self.skipTest("Not implemented") def test_710_add_alarm(self): self.skipTest("Not implemented") def test_770_add_bad_alarm(self): self.skipTest("Not implemented") def test_910_halt_testjob1(self): self.assertTrue(self.cronquery.halt_job("testjob1")) def test_920_halt_testjob2(self): self.assertTrue(self.cronquery.halt_job("testjob2")) if __name__ == '__main__': count_files = 0 sendplugin = XplPlugin(name = 'cronqt', daemonize = False, \ parser = None, nohub = True) #unittest.main() suite = unittest.TestLoader().loadTestsFromTestCase(QueryTestCase) #suite.addTests(unittest.TestLoader().loadTestsFromTestCase(IntervalTestCase)) unittest.TextTestRunner(verbosity=3).run(suite) sendplugin.force_leave()
r = subprocess.check_output('ps aux | grep ozwave', shell=True) print r test_folder = os.path.dirname(os.path.realpath(__file__)) ### global variables # the key will be the device address networkid = "ZwaveNetwork", driver = "/tmp/ttyS0" ### configuration # set up the plugin features # plugin = Plugin(name = 'test', # TODO: To replace by Plugin class when domogik plugintestcase will handle non xpl plugin = XplPlugin(name='test', daemonize=False, parser=None, test=True) # set up the plugin name name = "ozwave" # set up the configuration of the plugin # configuration is done in test_0010_configure_the_plugin with the cfg content # notice that the old configuration is deleted before cfg = { 'configured': True, 'autoconfpath': "Y", 'configpath': "/", 'cpltmsg': "Y", 'ozwlog': "Y" }