当前位置: 首页>>代码示例>>Python>>正文


Python XplPlugin.force_leave方法代码示例

本文整理汇总了Python中domogik.xpl.common.plugin.XplPlugin.force_leave方法的典型用法代码示例。如果您正苦于以下问题:Python XplPlugin.force_leave方法的具体用法?Python XplPlugin.force_leave怎么用?Python XplPlugin.force_leave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在domogik.xpl.common.plugin.XplPlugin的用法示例。


在下文中一共展示了XplPlugin.force_leave方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: enumerate

# 需要导入模块: from domogik.xpl.common.plugin import XplPlugin [as 别名]
# 或者: from domogik.xpl.common.plugin.XplPlugin import force_leave [as 别名]
    
        for idx, val in enumerate(params['xpl']):
            params['xpl'][idx]['value'] = DEVICE_NAME
    
        # go and create
        td.create_device(params)
        print "Device UPS {0} configured".format(DEVICE_NAME) 
    except:
        print(u"Error while creating the test devices : {0}".format(traceback.format_exc()))
        sys.exit(1)

    ### prepare and run the test suite
    suite = unittest.TestSuite()
    # check domogik is running, configure the plugin
    suite.addTest(NUTServeTestCase("test_0001_domogik_is_running", xpl_plugin, name, cfg))
    suite.addTest(NUTServeTestCase("test_0010_configure_the_plugin", xpl_plugin, name, cfg))

    # start the plugin
    suite.addTest(NUTServeTestCase("test_0050_start_the_plugin", xpl_plugin, name, cfg))

    # do the specific plugin tests
    suite.addTest(NUTServeTestCase("test_0110_send_test_battery", xpl_plugin, name, cfg))

   # do some tests comon to all the plugins
    suite.addTest(NUTServeTestCase("test_9900_hbeat", xpl_plugin, name, cfg))
    suite.addTest(NUTServeTestCase("test_9990_stop_the_plugin", xpl_plugin, name, cfg))
    unittest.TextTestRunner().run(suite)

    # quit
    xpl_plugin.force_leave()
开发者ID:Nico0084,项目名称:domogik-plugin-nutserve,代码行数:32,代码来源:010_tests.py

示例2: test_670_add_bad_alarm

# 需要导入模块: from domogik.xpl.common.plugin import XplPlugin [as 别名]
# 或者: from domogik.xpl.common.plugin.XplPlugin import force_leave [as 别名]
        self.skipTest("Not implemented")

    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()
开发者ID:ripleyXLR8,项目名称:domogik,代码行数:32,代码来源:cronquery_test.py

示例3:

# 需要导入模块: from domogik.xpl.common.plugin import XplPlugin [as 别名]
# 或者: from domogik.xpl.common.plugin.XplPlugin import force_leave [as 别名]
    suite.addTest(GeolocTestCase("test_0001_domogik_is_running", xpl_plugin, name, cfg))
    suite.addTest(GeolocTestCase("test_0010_configure_the_plugin", xpl_plugin, name, cfg))
    
    # start the plugin
    suite.addTest(GeolocTestCase("test_0050_start_the_plugin", xpl_plugin, name, cfg))

    # do the specific plugin tests
    suite.addTest(GeolocTestCase("test_0100_position", xpl_plugin, name, cfg))
    
    # wait for 2 seconds... why ? well... this is quite embarrasing to explain!
    # on my laptop, when the "stop the plugin" test is launched, an "active" 
    # plugin.status message is sent just before the "stopped" plugin.status 
    # message... and so, the plugin is seen as still active and the test fails
    # yeah, this need to be fixed in the testplugin.py file, but this will be 
    # done later so...
    time.sleep(2)

    # do some tests comon to all the plugins
    #suite.addTest(GeolocTestCase("test_9900_hbeat", xpl_plugin, name, cfg))
    suite.addTest(GeolocTestCase("test_9990_stop_the_plugin", xpl_plugin, name, cfg))
    
    # quit
    res = unittest.TextTestRunner().run(suite)
    if res.wasSuccessful() == True:
        rc = 0   # tests are ok so the shell return code is 0
    else:
        rc = 1   # tests are ok so the shell return code is != 0
    xpl_plugin.force_leave(return_code = rc)
     
    
开发者ID:fritz-smh,项目名称:domogik-plugin-geoloc,代码行数:30,代码来源:tests.py


注:本文中的domogik.xpl.common.plugin.XplPlugin.force_leave方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。