def test_switching(self):
        proto = self.getProtocol()
        mix = []
        SWITCH = "\x00\x00\x00\x00"
        for s in self.strings:
            mix.append(self.makeMessage(proto, s))
            mix.append(SWITCH)

        result = []
        def stringReceived(receivedString):
            result.append(receivedString)
            proto.recvd = proto.recvd[len(SWITCH):]

        proto.stringReceived = stringReceived
        proto.dataReceived("".join(mix))
        # Just another byte, to trigger processing of anything that might have
        # been left in the buffer (should be nothing).
        proto.dataReceived("\x01")
        self.assertEqual(result, self.strings)
        # And verify that another way
        self.assertEqual(proto.recvd, "\x01")
Iterate over all :class:`Mat` blocks by row and then by column.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/test/test_protocols.py/RecvdAttributeMixin.test_switching--crossover with--dataset/ETHPy150Open OP2/PyOP2/pyop2/petsc_base.py/Mat.__iter__