test_internet.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:hostapd-mana 作者: adde88 项目源码 文件源码
def testIterate(self):
        """
        Test that reactor.iterate(0) doesn't block
        """
        start = time.time()
        # twisted timers are distinct from the underlying event loop's
        # timers, so this fail-safe probably won't keep a failure from
        # hanging the test
        t = reactor.callLater(10, reactor.crash)
        reactor.iterate(0) # shouldn't block
        stop = time.time()
        elapsed = stop - start
        #print "elapsed", elapsed
        self.failUnless(elapsed < 8)
        t.cancel()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号