'L{ftp.FTPClient.rename} issues I{RNTO} and I{RNFR} commands and returns
a L{Deferred} which fires when a file has successfully been renamed.'

def test_renameFromTo(self):

    self._testLogin()
    d = self.client.rename('/spam', '/ham')
    self.assertEqual(self.transport.value(), 'RNFR    /spam\r\n')
    self.transport.clear()
    fromResponse = '350    Requested    file    action    pending    further    information.\r\n'
    self.client.lineReceived(fromResponse.encode(self.client._encoding))
    self.assertEqual(self.transport.value(), 'RNTO    /ham\r\n')
    toResponse = '250    Requested    File    Action    Completed    OK'
    self.client.lineReceived(toResponse.encode(self.client._encoding))
    d.addCallback(self.assertEqual, ([fromResponse], [toResponse]))
    return d
