'Set up a C{os.rename} that will fail with L{errno.EXDEV} on first call.
This is used to simulate a cross-device rename failure.
@return: a list of pair (src, dest) of calls to C{os.rename}
@rtype: C{list} of C{tuple}'

def setUpFaultyRename(self):

    invokedWith = []
    def faultyRename(src, dest):
        invokedWith.append((src, dest))
        if (len(invokedWith) == 1):
            raise OSError(errno.EXDEV, 'Test-induced    failure    simulating    cross-device    rename    failure')
        return originalRename(src, dest)
    originalRename = os.rename
    self.patch(os, 'rename', faultyRename)
    return invokedWith
