Changeset 106

Show
Ignore:
Timestamp:
2002-03-29 21:52:43 (7 years ago)
Author:
schwa
Message:
Module: removed rather trivial tests in TestDirectories class (and the
    class itself ;-) ).
Files:

Legend:

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

    r105 r106  
    3030# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    3131 
    32 # $Id: _test_ftputil.py,v 1.24 2002/03/29 21:51:52 schwa Exp $ 
     32# $Id: _test_ftputil.py,v 1.25 2002/03/29 21:52:43 schwa Exp $ 
    3333 
    3434# Ideas for future development: 
     
    7777        self.assertRaises(ftputil.FTPOSError, FTPHostWrapper, 
    7878                          _mock_ftplib.FailOnLoginSession) 
    79  
    80  
    81 class TestDirectories(Base): 
    82     """Getting, making, changing, deleting directories.""" 
    83  
    84     def test_getcwd_and_change(self): 
    85         """Test FTPHost.getcwd and FTPHost.chdir.""" 
    86         host = self.host 
    87         self.assertEqual( host.getcwd(), self.rootdir ) 
    88         host.chdir(self.testdir) 
    89         self.assertEqual( host.getcwd(), self.testdir ) 
    90  
    91     def test_mkdir(self): 
    92         """Test FTPHost.mkdir.""" 
    93         host = self.host 
    94         # use invalid directory name (__test2 doesn't exist) 
    95         self.assertRaises( ftputil.PermanentError, host.mkdir, 
    96           host.path.join(self.rootdir, '__test2', '__test3') ) 
    97         # this is valid 
    98         host.mkdir( host.path.join(self.testdir, '__test2') ) 
    99         # repeat first mkdir (now valid) 
    100         host.mkdir( host.path.join(self.testdir, '__test2', 
    101                                    '__test3') ) 
    102         # clean up for this test 
    103         host.rmdir( host.path.join(self.testdir, '__test2', 
    104                                    '__test3') ) 
    105         host.rmdir( host.path.join(self.testdir, '__test2') ) 
    106  
    107     def test_rmdir(self): 
    108         """Test FTPHost.rmdir.""" 
    109         host = self.host 
    110         # try to remove nonexistent directory 
    111         self.assertRaises( ftputil.PermanentError, host.rmdir, 
    112           host.path.join(self.testdir, '__test2') ) 
    113         # make two nested directories 
    114         host.mkdir( host.path.join(self.testdir, '__test2') ) 
    115         host.mkdir( host.path.join(self.testdir, '__test2', 
    116                                    '__test3') ) 
    117         # try to remove non-empty directory 
    118         self.assertRaises( ftputil.PermanentError, host.rmdir, 
    119           host.path.join(self.testdir, '__test2') ) 
    120         # remove leaf dir __test3 
    121         host.rmdir( host.path.join(self.testdir, '__test2', 
    122                                    '__test3') ) 
    123         # try to remove a dir we are in 
    124         host.chdir(self.testdir) 
    125         host.chdir('./__test2') 
    126         self.assertRaises( ftputil.PermanentError, host.rmdir, 
    127           host.path.join(self.testdir, '__test2') ) 
    128         # finally remove __test2 
    129         host.chdir(self.rootdir) 
    130         host.rmdir( host.path.join(self.testdir, '__test2') ) 
    13179 
    13280