def test_buffer(self):
        for packet_size in range(1, 10):
            t = proto_helpers.StringTransport()
            a = TestNetstring()
            a.MAX_LENGTH = 699
            a.makeConnection(t)
            for s in self.strings:
                a.sendString(s)
            out = t.value()
            for i in range(len(out) // packet_size + 1):
                s = out[i*packet_size:(i+1)*packet_size]
                if s:
                    a.dataReceived(s)
            self.assertEqual(a.received, self.strings)
Strings can be received in chunks of different lengths.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/test/test_protocols.py/NetstringReceiverTestCase.test_buffer