File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,17 @@ def test_sftp_setstat(self):
270270 finally :
271271 os .unlink (remote_filename )
272272
273+ def test_realpath_failure (self ):
274+ self .assertEqual (self ._auth (), 0 )
275+ sftp = self .session .sftp_init ()
276+ self .assertTrue (sftp is not None )
277+ # Depends on library version which error is returned
278+ try :
279+ self .assertRaises (SFTPBufferTooSmall ,
280+ sftp .realpath , 'fake path' , max_len = 1 )
281+ except SFTPHandleError :
282+ pass
283+
273284 def test_sftp_symlink_realpath_lstat (self ):
274285 self .assertEqual (self ._auth (), 0 )
275286 sftp = self .session .sftp_init ()
@@ -281,8 +292,6 @@ def test_sftp_symlink_realpath_lstat(self):
281292 fh .write (test_data )
282293 symlink_target = os .sep .join ([os .path .dirname (__file__ ),
283294 'remote_symlink' ])
284- self .assertRaises (SFTPBufferTooSmall ,
285- sftp .realpath , symlink_target , max_len = 1 )
286295 try :
287296 self .assertEqual (sftp .symlink (remote_filename , symlink_target ), 0 )
288297 lstat = sftp .lstat (symlink_target )
You can’t perform that action at this time.
0 commit comments