'Check output of cftp client for a put request.
@param transfers: List with tuple of (local, remote, progress).
@param randomOrder: When set to C{True}, it will ignore the order
in which put reposes are received'

def checkPutMessage(self, transfers, randomOrder=False):

    output = self.client.transport.value()
    if _PY3:
        output = output.decode('utf-8')
    output = output.split('\n\r')
    expectedOutput = []
    actualOutput = []
    for (local, remote, expected) in transfers:
        expectedTransfer = []
        for line in expected:
            expectedTransfer.append(('%s    %s' % (local, line)))
        expectedTransfer.append(('Transferred    %s    to    %s' % (local, remote)))
        expectedOutput.append(expectedTransfer)
        progressParts = output.pop(0).strip('\r').split('\r')
        actual = progressParts[:(-1)]
        last = progressParts[(-1)].strip('\n').split('\n')
        actual.extend(last)
        actualTransfer = []
        for line in actual[:(-1)]:
            line = line.strip().rsplit('    ', 2)[0]
            line = line.strip().split('    ', 1)
            actualTransfer.append(('%s    %s' % (line[0], line[1].strip())))
        actualTransfer.append(actual[(-1)])
        actualOutput.append(actualTransfer)
    if randomOrder:
        self.assertEqual(sorted(expectedOutput), sorted(actualOutput))
    else:
        self.assertEqual(expectedOutput, actualOutput)
    self.assertEqual(0, len(output), 'There    are    still    put    responses    which    were    not    checked.')
