'After establishing the connection, when the command on the SSH server
produces output, it is delivered to the protocol\'s C{dataReceived}
method.'

def test_dataReceived(self):

    self.realm.channelLookup['session'] = WorkingExecSession
    endpoint = self.create()
    factory = Factory()
    factory.protocol = Protocol
    connected = endpoint.connect(factory)
    (server, client, pump) = self.finishConnection()
    protocol = self.successResultOf(connected)
    dataReceived = []
    protocol.dataReceived = dataReceived.append
    channelId = protocol.transport.id
    server.service.channels[channelId].write('hello,    world')
    pump.pump()
    self.assertEqual('hello,    world', ''.join(dataReceived))
