Changeset 157
- Timestamp:
- 2002-04-01 13:58:28 (7 years ago)
- Files:
-
- trunk/_test_ftputil.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/_test_ftputil.py
r152 r157 30 30 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 31 32 # $Id: _test_ftputil.py,v 1.5 6 2002/03/31 23:20:35schwa Exp $32 # $Id: _test_ftputil.py,v 1.57 2002/04/01 13:58:28 schwa Exp $ 33 33 34 34 import unittest … … 94 94 def upload(self, source, target, mode=''): 95 95 assert 0, "FTPHost.upload should not have been called" 96 96 97 97 def download(self, source, target, mode=''): 98 98 assert 0, "FTPHost.download should not have been called" … … 121 121 self.assertEqual(host.closed, 1) 122 122 self.assertEqual(host._children, []) 123 123 124 124 125 125 class TestLogin(unittest.TestCase): 126 126 127 127 def test_invalid_login(self): 128 128 """Login to invalid host must fail.""" … … 146 146 147 147 def test_lstat_one_file(self): 148 """Test FTPHost.lstat for a file."""148 """Test lstat for a file.""" 149 149 host = ftp_host_factory() 150 150 stat_result = host.lstat('/home/sschwarzer/index.html') 151 151 self.assertEqual( oct(stat_result.st_mode), '0100644' ) 152 152 self.assertEqual(stat_result.st_size, 4604) 153 self.assertEqual(stat_result.st_name, 'index.html') 154 self.assertEqual(stat_result.st_target, None) 153 155 154 156 def test_lstat_one_dir(self): 155 """Test FTPHost.lstat for a directory.""" 156 # some directory 157 """Test lstat for a directory.""" 157 158 host = ftp_host_factory() 158 159 stat_result = host.lstat('/home/sschwarzer/scios2') … … 168 169 self.assertEqual(stat_result.st_ctime, None) 169 170 self.assertEqual(stat_result.st_name, 'scios2') 171 self.assertEqual(stat_result.st_target, None) 170 172 171 173 def test_lstat_via_stat_module(self): 172 """Test FTPHost.lstat indirectly via stat module."""174 """Test lstat indirectly via stat module.""" 173 175 host = ftp_host_factory() 174 176 stat_result = host.lstat('/home/sschwarzer/') 175 177 self.failUnless( stat.S_ISDIR(stat_result.st_mode) ) 176 178 179 # def test_stat_following_link(self): 180 # """Test stat when invoked on a link.""" 181 # host = ftp_host_factory() 182 # stat_result = host.lstat('/home/a_link') 183 # self.failUnless(stat_result.st_name, 177 184 178 185 class TestListdir(unittest.TestCase): … … 408 415 source_file.write(data) 409 416 source_file.close() 410 417 411 418 def test_ascii_upload(self): 412 419 """Test ASCII mode upload.""" … … 464 471 # clean up 465 472 os.unlink(local_source) 466 473 467 474 def compare_and_delete_downloaded_data(self, filename): 468 475 """Compare content of downloaded file with its source, then
