Changeset 184

Show
Ignore:
Timestamp:
2002-04-03 21:50:24 (7 years ago)
Author:
schwa
Message:
TestStat: added a test to check for RootDirError if stat is requested for
    the root directory.
Files:

Legend:

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

    r164 r184  
    3030# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    3131 
    32 # $Id: _test_ftputil.py,v 1.59 2002/04/01 16:24:05 schwa Exp $ 
     32# $Id: _test_ftputil.py,v 1.60 2002/04/03 21:50:24 schwa Exp $ 
    3333 
    3434import unittest 
     
    145145                          '/home/sschwarzer/notthere') 
    146146 
     147    def test_lstat_for_root(self): 
     148        """Test lstat for / . 
     149        Note: (l)stat works by going one directory up and parsing 
     150        the output of an FTP DIR command. Unfortunately, it is not 
     151        possible to to this for the root directory / . 
     152        """ 
     153        host = ftp_host_factory() 
     154        self.assertRaises(ftputil.RootDirError, host.lstat, '/') 
     155        try: 
     156            host.lstat('/') 
     157        except ftputil.RootDirError, exc_obj: 
     158            self.failIf( isinstance(exc_obj, ftputil.FTPOSError) ) 
     159         
    147160    def test_lstat_one_file(self): 
    148161        """Test lstat for a file."""