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
评论列表
文章目录