Changeset 131

Show
Ignore:
Timestamp:
2002-03-30 18:46:59 (7 years ago)
Author:
schwa
Message:
MockSession: patched transfercmd so it will raise ftplib.error_perm if
    getting a "RETR notthere" command.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/_mock_ftplib.py

    r122 r131  
    3030# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    3131 
    32 # $Id: _mock_ftplib.py,v 1.10 2002/03/30 17:40:03 schwa Exp $ 
     32# $Id: _mock_ftplib.py,v 1.11 2002/03/30 18:46:59 schwa Exp $ 
    3333 
    3434""" 
     
    328328    """ 
    329329    def __init__(self, mock_file_content=''): 
     330        if DEBUG: 
     331            print 'File content: *%s*' % mock_file_content 
    330332        self.mock_file_content = mock_file_content 
    331333 
     
    418420        if self.dir_contents.has_key(path): 
    419421            raise ftplib.error_perm 
     422        # fail if path isn't available (this name is hard-coded here 
     423        #  and has to be used for the corresponding tests) 
     424        if cmd == 'RETR' and path == 'notthere': 
     425            raise ftplib.error_perm 
    420426        return MockSocket(self.mock_file_content) 
    421427