def test_cancelTimeoutAlreadyCalled(self):
        """
        Does nothing if no timeout is already reached.
        """
        sut, clock = self.getProtocolAndClock()
        wrappedProto = sut.wrappedProtocol
        sut.setTimeout(3)
        # Trigger the timeout call.
        clock.advance(3)
        self.assertTrue(wrappedProto.disconnected)

        # No error is raised when trying to cancel it.
        sut.cancelTimeout()

        Does nothing if no timeout is already reached.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_policies.py