'Client and server transports implement L{ILoggingContext.logPrefix} to
return a message reflecting the protocol they are running.'

def test_logPrefix(self):

    class CustomLogPrefixProtocol(ConnectableProtocol, ):
        def __init__(self, prefix):
            self._prefix = prefix
            self.system = None
        def connectionMade(self):
            self.transport.write('a')
        def logPrefix(self):
            return self._prefix
        def dataReceived(self, bytes):
            self.system = context.get(ILogContext)['system']
            self.transport.write('b')
            if ('b' in bytes):
                self.transport.loseConnection()
    client = CustomLogPrefixProtocol('Custom    Client')
    server = CustomLogPrefixProtocol('Custom    Server')
    runProtocolsWithReactor(self, server, client, self.endpoints)
    self.assertIn('Custom    Client', client.system)
    self.assertIn('Custom    Server', server.system)
