Changeset 161
- Timestamp:
- 2002-04-01 15:06:36 (7 years ago)
- Files:
-
- trunk/_test_ftputil.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/_test_ftputil.py
r157 r161 30 30 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 31 32 # $Id: _test_ftputil.py,v 1.5 7 2002/04/01 13:58:28schwa Exp $32 # $Id: _test_ftputil.py,v 1.58 2002/04/01 15:06:36 schwa Exp $ 33 33 34 34 import unittest … … 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)155 153 156 154 def test_lstat_one_dir(self): … … 168 166 self.assertEqual(stat_result.st_mtime, 937785600.0) 169 167 self.assertEqual(stat_result.st_ctime, None) 170 self.assertEqual( stat_result.st_name, 'scios2')171 self.assertEqual(stat_result.st_target, None)168 self.assertEqual( stat_result, (17901, None, None, 6, '45854', '200', 169 512, None, 937785600.0, None) ) 172 170 173 171 def test_lstat_via_stat_module(self): … … 177 175 self.failUnless( stat.S_ISDIR(stat_result.st_mode) ) 178 176 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 def test_stat_following_link(self): 178 """Test stat when invoked on a link.""" 179 host = ftp_host_factory() 180 # simple link 181 stat_result = host.stat('/home/link') 182 self.assertEqual(stat_result.st_size, 4604) 183 # link pointing to a link 184 stat_result = host.stat('/home/python/link_link') 185 self.assertEqual(stat_result.st_size, 4604) 186 stat_result = host.stat('../python/link_link') 187 self.assertEqual(stat_result.st_size, 4604) 188 # recursive link structures 189 self.assertRaises(ftputil.PermanentError, host.stat, 190 '../python/bad_link') 191 self.assertRaises(ftputil.PermanentError, host.stat, 192 '/home/bad_link') 193 184 194 185 195 class TestListdir(unittest.TestCase): … … 228 238 # test a link 229 239 testlink = '/home/sschwarzer/osup' 230 #XXX uncomment these two when following links is implemented 231 #self.failIf( host.path.isdir(testlink) ) 232 #self.failIf( host.path.isfile(testlink) ) 240 self.failIf( host.path.isdir(testlink) ) 241 self.failIf( host.path.isfile(testlink) ) 233 242 self.failUnless( host.path.islink(testlink) ) 234 243
