Changeset 118
- Timestamp:
- 2002-03-30 15:36:25 (7 years ago)
- Files:
-
- trunk/_test_ftputil.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/_test_ftputil.py
r117 r118 30 30 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 31 32 # $Id: _test_ftputil.py,v 1.3 2 2002/03/30 15:31:30schwa Exp $32 # $Id: _test_ftputil.py,v 1.33 2002/03/30 15:36:25 schwa Exp $ 33 33 34 34 import unittest … … 58 58 59 59 class TestStat(unittest.TestCase): 60 """Test FTPHost.lstat, FTPHost.stat, FTPHost.listdir. 61 (test currently only implemented for Unix server format. 60 """ 61 Test FTPHost.lstat and FTPHost.stat (test currently only 62 implemented for Unix server format). 62 63 """ 63 64 … … 65 66 """Test whether lstat fails for a nonexistent path.""" 66 67 host = FTPHostWrapper(_mock_ftplib.MockSession) 68 self.assertRaises(ftputil.PermanentError, host.lstat, 69 '/home/sschw/notthere') 67 70 self.assertRaises(ftputil.PermanentError, host.lstat, 68 71 '/home/sschwarzer/notthere') … … 74 77 self.assertEqual( oct(stat_result.st_mode), '0100644' ) 75 78 self.assertEqual(stat_result.st_size, 4604) 76 79 77 80 def test_lstat_one_dir(self): 78 81 """Test FTPHost.lstat with a directory.""" … … 91 94 self.assertEqual(stat_result.st_ctime, None) 92 95 self.assertEqual(stat_result.st_name, 'scios2') 93 96 94 97 def test_lstat_via_stat_module(self): 95 98 """Test FTPHost.lstat indirectly via stat module.""" … … 98 101 self.failUnless( stat.S_ISDIR(stat_result.st_mode) ) 99 102 100 def test_listdir(self): 101 """Test FTPHost.listdir.""" 102 # try to list a path which isn't there 103 104 class TestListdir(unittest.TestCase): 105 """Test FTPHost.listdir.""" 106 107 def test_failing_listdir(self): 108 """Test failing FTPHost.listdir.""" 103 109 host = FTPHostWrapper(_mock_ftplib.MockSession) 104 110 self.assertRaises(ftputil.PermanentError, 105 111 host.listdir, 'notthere') 112 113 def test_succeeding_listdir(self): 114 """Test succeeding FTPHost.listdir.""" 106 115 # do we have all expected "files"? 107 116 host = FTPHostWrapper(_mock_ftplib.MockSession) … … 200 209 # input_.close() 201 210 # self.assertEqual(local_data, remote_data) 202 # 211 # 203 212 # def ascii_write(self): 204 213 # """Write an ASCII to the host and check the written file."""
