summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2006-04-20 00:26:27 -0700
committerRobey Pointer <robey@lag.net>2006-04-20 00:26:27 -0700
commitabb7f1f1ba4276274b4c131355508b2f4e90f906 (patch)
treecd6bbdeea9ed4aae79dfddc5ab0a81e211a1677d /tests
parentd965f00563ef23dc3b105c3d1272075ec18c01af (diff)
[project @ robey@lag.net-20060420072627-958cad5e36cb8ecc]
fix a bug where prefetch() at EOF would throw an exception, and add a unit test
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_sftp.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/test_sftp.py b/tests/test_sftp.py
index 6172a0dc..3bc11e3e 100755
--- a/tests/test_sftp.py
+++ b/tests/test_sftp.py
@@ -622,3 +622,20 @@ class SFTPTest (unittest.TestCase):
self.fail('exception ' + e)
sftp.unlink(FOLDER + '/\xc3\xbcnic\xc3\xb8\x64\x65')
+ def test_L_bad_readv(self):
+ """
+ verify that readv at the end of the file doesn't essplode.
+ """
+ f = sftp.open(FOLDER + '/zero', 'w')
+ f.close()
+ try:
+ f = sftp.open(FOLDER + '/zero', 'r')
+ data = f.readv([(0, 12)])
+ f.close()
+
+ f = sftp.open(FOLDER + '/zero', 'r')
+ f.prefetch()
+ data = f.read(100)
+ f.close()
+ finally:
+ sftp.unlink(FOLDER + '/zero')