Ticket #5441: 5441.2.diff

File 5441.2.diff, 1.7 KB (added by Adi Roiban, 10 years ago)
  • twisted/protocols/ftp.py

    === modified file 'twisted/protocols/ftp.py'
     
    10271027
    10281028
    10291029    def ftp_RETR(self, path):
     1030        """
     1031        This command causes the content of a file to be sent over the data
     1032        transfer channel. If the path is to a folder, an error will be raised.
     1033
     1034        @type path: C{str}
     1035        @param path: The path to the file which should be transferred over the
     1036        data transfer channel.
     1037
     1038        @rtype: L{Deferred}
     1039        @return: a L{Deferred} which will be fired when the transfer is done.
     1040        """
    10301041        if self.dtpInstance is None:
    10311042            raise BadCmdSequenceError('PORT or PASV required before RETR')
    10321043
  • twisted/test/test_ftp.py

    === modified file 'twisted/test/test_ftp.py'
     
    546546        return d
    547547
    548548
    549     def testDownloadFolder(self):
    550         # Make a directory in the current working directory
     549    def test_downloadFolder(self):
     550        '''When RETR is called for a folder, it will fail complaining that
     551        the path is a folder.
     552        '''
     553        #Make a directory in the current working directory
    551554        self.dirPath.child('foo').createDirectory()
    552555        # Login
    553556        d = self._anonymousLogin()
     
    560563        d.addCallback(retrFolder)
    561564
    562565        def failOnSuccess(result):
    563             raise AssertionError('Downloading a file should not succeed.')
     566            raise AssertionError('Downloading a folder should not succeed.')
    564567        d.addCallback(failOnSuccess)
    565568
    566569        def checkError(failure):