test_protocol.py 文件源码

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

项目:txdarn 作者: markrwilliams 项目源码 文件源码
def test_timedOutCallback(self):
        '''The termination deferred's callback sets disconnecting and calls
        connectionLost.  Setting disconnecting avoids errbacking the
        deferred that's just been fired!

        '''
        terminationDeferred = self.protocol.terminationDeferred

        def assertConnectionLostCalled(ignored):
            self.assertTrue(self.protocol.disconnecting)
            self.assertEqual(self.sessionMachineRecorder.connectionsLost,
                             connectionDone)

        terminationDeferred.callback(P.TimeoutClock.EXPIRED)
        return terminationDeferred
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号