Changeset 105

Show
Ignore:
Timestamp:
2002-03-29 21:51:52 (7 years ago)
Author:
schwa
Message:
Module: removed rather trivial tests in TestRemoveAndRename class.
Files:

Legend:

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

    r104 r105  
    3030# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    3131 
    32 # $Id: _test_ftputil.py,v 1.23 2002/03/29 21:50:41 schwa Exp $ 
     32# $Id: _test_ftputil.py,v 1.24 2002/03/29 21:51:52 schwa Exp $ 
    3333 
    3434# Ideas for future development: 
     
    7777        self.assertRaises(ftputil.FTPOSError, FTPHostWrapper, 
    7878                          _mock_ftplib.FailOnLoginSession) 
    79  
    80  
    81 class TestRemoveAndRename(Base): 
    82     """Removing and renaming files.""" 
    83  
    84     def test_remove(self): 
    85         """Test FTPHost.remove.""" 
    86         host = self.host 
    87         # try to remove a file which is not there 
    88         self.assertRaises( ftputil.PermanentError, host.remove, 
    89           host.path.join(self.testdir, 'notthere') ) 
    90         # remove a directory and check if it's removed 
    91         host.mkdir( host.path.join(self.testdir, '__test2') ) 
    92         host.remove( host.path.join(self.testdir, '__test2') ) 
    93         self.failIf( host.path.exists( host.path.join( 
    94                      self.testdir, '__test2') ) ) 
    95         # remove a file and check if it's removed 
    96         host.upload( 'ftputil.py', host.path.join(self.testdir, 
    97                      'ftputil2.py'), 'b' ) 
    98         host.unlink( host.path.join(self.testdir, 
    99                                     'ftputil2.py') ) 
    100         self.failIf( host.path.exists( host.path.join( 
    101                      self.testdir, 'ftputil2.py') ) ) 
    102  
    103     def test_rename(self): 
    104         """Test FTPHost.rename.""" 
    105         host = self.host 
    106         # try to rename a file which is not there 
    107         host.chdir(self.testdir) 
    108         self.assertRaises(ftputil.PermanentError, host.rename, 
    109                           'notthere', 'notthere2') 
    110         # upload a file, rename it and look if the name 
    111         #  has changed 
    112         host.upload('ftputil.py', 'ftputil2.py', 'b') 
    113         host.rename('ftputil2.py', 'ftputil3.py') 
    114         self.failIf( host.path.exists('ftputil2.py') ) 
    115         self.failUnless( host.path.exists('ftputil3.py') ) 
    116         # clean up 
    117         host.remove('ftputil3.py') 
    118         host.chdir(self.rootdir) 
    11979 
    12080