def test_receiveAvoidsTimeout(self):
        # Let half the countdown period elapse
        self.clock.pump([0.0, 1.0, 0.5])
        self.failIf(self.proto.wrappedProtocol.disconnected)

        # Some bytes arrive, they should reset the counter
        self.proto.dataReceived('bytes bytes bytes')

        # We pass the original timeout
        self.clock.pump([0.0, 1.0, 1.0])
        self.failIf(self.proto.wrappedProtocol.disconnected)

        # Nothing more arrives though, the new timeout deadline is passed,
        # the connection should be dropped.
        self.clock.pump([0.0, 1.0, 1.0])
        self.failUnless(self.proto.wrappedProtocol.disconnected)
Make sure that receiving data also resets the timeout countdown.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/test/test_policies.py/TimeoutTestCase.test_receiveAvoidsTimeout