diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-09-18 13:32:24 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-09-18 13:32:24 -0700 |
commit | fb3c81bf423b673526768fe4b506e3d74d295ac5 (patch) | |
tree | b81107cd3d417145cc9eb7dbe863fd32fb4a8a2a | |
parent | 7091aadbaf0bc2c24e83843f9756a799a48e3d48 (diff) |
Clean up & tweak failing sftp closure test
-rwxr-xr-x | tests/test_sftp.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/test_sftp.py b/tests/test_sftp.py index 58013cfd..a35914e1 100755 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -203,7 +203,10 @@ class SFTPTest (unittest.TestCase): with sftp: pass try: - self._assert_opening_file_raises_error(sftp) + sftp.open(FOLDER + '/test2', 'w') + self.fail('expected exception') + except EOFError, socket.error: + pass finally: sftp = paramiko.SFTP.from_transport(tc) @@ -808,14 +811,6 @@ class SFTPTest (unittest.TestCase): sftp.remove('%s/nonutf8data' % FOLDER) - def _assert_opening_file_raises_error(self, sftp): - try: - sftp.open(FOLDER + '/test2', 'w') - self.fail('expected exception') - except EOFError: - pass - - if __name__ == '__main__': SFTPTest.init_loopback() # logging is required by test_N_file_with_percent |