'Test one of the permutations of write/writeSequence client/server.
@param write: The name of the method to test, C{"write"} or
C{"writeSequence"}.'

def _greetingtest(self, write, testServer):

    class GreeteeProtocol(Protocol, ):
        bytes = ''
        def dataReceived(self, bytes):
            self.bytes += bytes
            if (self.bytes == 'bytes'):
                self.received.callback(None)
    class GreeterProtocol(Protocol, ):
        def connectionMade(self):
            if (write == 'write'):
                self.transport.write('bytes')
            else:
                self.transport.writeSequence(['byt', 'es'])
    if testServer:
        server = GreeterProtocol()
        client = GreeteeProtocol()
        d = client.received = Deferred()
    else:
        server = GreeteeProtocol()
        d = server.received = Deferred()
        client = GreeterProtocol()
    loopback.loopbackAsync(server, client)
    return d
