'L{TuntapPort.doRead} reads several datagrams, of up to
C{TuntapPort.maxThroughput} bytes total, before returning.'

def test_doReadSeveralDatagrams(self):

    values = cycle(iterbytes('abcdefghijklmnopqrstuvwxyz'))
    total = 0
    datagrams = []
    while (total < self.port.maxThroughput):
        datagrams.append((next(values) * self.port.maxPacketSize))
        total += self.port.maxPacketSize
    self.port.startListening()
    tunnel = self.system.getTunnel(self.port)
    tunnel.readBuffer.extend(datagrams)
    tunnel.readBuffer.append('excessive    datagram,    not    to    be    read')
    self.port.doRead()
    self.assertEqual(datagrams, self.protocol.received)
