'L{LineReceiver.clearLineBuffer} removes all buffered data and returns
it as a C{bytes} and can be called from beneath C{dataReceived}.'

def test_clearLineBuffer(self):

    class ClearingReceiver(basic.LineReceiver, ):
        def lineReceived(self, line):
            self.line = line
            self.rest = self.clearLineBuffer()
    protocol = ClearingReceiver()
    protocol.dataReceived('foo\r\nbar\r\nbaz')
    self.assertEqual(protocol.line, 'foo')
    self.assertEqual(protocol.rest, 'bar\r\nbaz')
    protocol.dataReceived('quux\r\n')
    self.assertEqual(protocol.line, 'quux')
    self.assertEqual(protocol.rest, '')
