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


Python TestEventLogger.expectAtLeastNevents方法代码示例

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


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

示例1: testWebbrickStatusQuery

# 需要导入模块: from EventHandlers.tests import TestEventLogger [as 别名]
# 或者: from EventHandlers.tests.TestEventLogger import expectAtLeastNevents [as 别名]
    def testWebbrickStatusQuery(self):
        self._log.debug( "\n\ntestWebbrickStatusQuery" )

        self.loader = EventRouterLoader()
        self.loader.loadHandlers( getDictFromXmlString(testConfigWebbrickStatusQuery) )
        self.loader.start()  # all tasks
        self.router = self.loader.getEventRouter()

        self.router.publish( EventAgent("TestWebbrickStatusMonitor"), Events.evtSecond5 )   # so webbrick is in list for recover
        self.router.publish( EventAgent("TestWebbrickStatusMonitor"), Events.evtMinute1 )    # do recover
        waitNSeconds(2)   # recover is async
        self.router.publish( EventAgent("TestWebbrickStatusMonitor"), Events.evtSecond5 )   # do scan
        waitNSeconds(2)   # scan is async

        # We should see lots of events here as initial pass.

        # my test rig only has 1 temp sensors.
        # so:
        # 1 temp sensors
        # 4 analogue in
        # 4 analogue out
        # 12 digital in
        # 8 digital out
        # 8 mimic out
        self.assert_( TestEventLogger.expectAtLeastNevents(36+NUM_TEMP_SENSORS), "expecting %u events" % (36+NUM_TEMP_SENSORS)  )
        oldLen = len(TestEventLogger._events)

        self.router.publish( EventAgent("TestWebbrickStatusMonitor"), Events.evtSecond5 )   # do scan
        waitNSeconds(2)   # scan is async

        TestEventLogger.logEvents()
        self.assert_( oldLen <= len(TestEventLogger._events) )
开发者ID:AndyThirtover,项目名称:wb_gateway,代码行数:34,代码来源:TestWebbrickStatusQuery.py

示例2: testWebbrickStatusQueryReal

# 需要导入模块: from EventHandlers.tests import TestEventLogger [as 别名]
# 或者: from EventHandlers.tests.TestEventLogger import expectAtLeastNevents [as 别名]
    def testWebbrickStatusQueryReal(self):
        self._log.debug( "\n\ntestWebbrickStatusQueryReal" )

        self.loader = EventRouterLoader()
        self.loader.loadHandlers( getDictFromXmlString(testConfigWebbrickStatusQueryReal) )
        self.loader.start()  # all tasks
        self.router = self.loader.getEventRouter()

        self.router.publish( EventAgent("TestWebbrickStatusMonitor"), Events.evtSecond5 )   # so webbrick is in list for recover
        waitNSeconds(2)   # scan is async
        self.router.publish( EventAgent("TestWebbrickStatusMonitor"), Events.evtMinute1 )    # do discover
        waitNSeconds(30)
        self.router.publish( EventAgent("TestWebbrickStatusMonitor"), Events.evtMinute1 )    # do recover
        waitNSeconds(2)   # recover is async
        self.router.publish( EventAgent("TestWebbrickStatusMonitor"), Events.evtSecond5 )   # do scan
        waitNSeconds(2)   # scan is async

        # We should see lots of events here as initial pass.
        self.assert_( TestEventLogger.expectAtLeastNevents(10), "expecting %u events" % (10)  )
开发者ID:AndyThirtover,项目名称:wb_gateway,代码行数:21,代码来源:TestWebbrickStatusQuery.py


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