def test_multipleLongLines(self):
"""
If L{LineReceiver.dataReceived} is called with more than
C{LineReceiver.MAX_LENGTH} bytes containing multiple line delimiters
somewhere not in the first C{MAX_LENGTH} bytes, the entire byte string
is passed to L{LineReceiver.lineLengthExceeded}.
"""
excessive = (
b'x' * (self.proto.MAX_LENGTH * 2 + 2) + self.proto.delimiter) * 2
self.proto.dataReceived(excessive)
self.assertEqual([excessive], self.proto.longLines)
评论列表
文章目录