'Test creating a LineBuffer and feeding it some lines.  The lines should
build up in its internal buffer for a while and then get spat out to
the writer.'

def testLineBuffering(self):

    output = []
    input = iter(itertools.cycle(['012', '345', '6', '7', '8', '9']))
    c = pop3._IteratorBuffer(output.extend, input, 6)
    i = iter(c)
    self.assertEqual(output, [])
    i.next()
    self.assertEqual(output, [])
    i.next()
    self.assertEqual(output, [])
    i.next()
    self.assertEqual(output, ['012', '345', '6'])
    for n in range(5):
        i.next()
    self.assertEqual(output, ['012', '345', '6', '7', '8', '9', '012', '345'])
