'The transport of a protocol connected with L{IReactorTCP.connectTCP} or
L{IReactor.TCP.listenTCP} can have its I{TCP_NODELAY} state inspected
and manipulated with L{ITCPTransport.getTcpNoDelay} and
L{ITCPTransport.setTcpNoDelay}.'

def test_tcpNoDelay(self):

    def check(serverProtocol, clientProtocol):
        for p in [serverProtocol, clientProtocol]:
            transport = p.transport
            self.assertEqual(transport.getTcpNoDelay(), 0)
            transport.setTcpNoDelay(1)
            self.assertEqual(transport.getTcpNoDelay(), 1)
            transport.setTcpNoDelay(0)
            self.assertEqual(transport.getTcpNoDelay(), 0)
    return self._connectedClientAndServerTest(check)
