'L{ftp.FTPClient.rename} issues I{RNTO} and I{RNFR} commands with paths
escaped according to U{http://cr.yp.to/ftp/filesystem.html}.'

def test_renameFromToEscapesPaths(self):

    self._testLogin()
    fromFile = '/foo/ba\nr/baz'
    toFile = '/qu\nux'
    self.client.rename(fromFile, toFile)
    self.client.lineReceived('350    ')
    self.client.lineReceived('250    ')
    self.assertEqual(self.transport.value(), 'RNFR    /foo/ba\x00r/baz\r\nRNTO    /qu\x00ux\r\n')
