diff options
Diffstat (limited to 'tests/test_sftp.py')
-rwxr-xr-x | tests/test_sftp.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/test_sftp.py b/tests/test_sftp.py index 79a52c25..5d4d921c 100755 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -63,6 +63,7 @@ decreased compared with chicken. FOLDER = os.environ.get('TEST_FOLDER', 'temp-testing') sftp = None +tc = None g_big_file_test = True @@ -101,7 +102,7 @@ class SFTPTest (unittest.TestCase): init = staticmethod(init) def init_loopback(): - global sftp + global sftp, tc socks = LoopSocket() sockc = LoopSocket() @@ -144,6 +145,20 @@ class SFTPTest (unittest.TestCase): finally: sftp.remove(FOLDER + '/test') + def test_1a_close(self): + """ + verify that closing the sftp session doesn't do anything bad, and that + a new one can be opened. + """ + global sftp + sftp.close() + try: + sftp.open(FOLDER + '/test2', 'w') + self.fail('expected exception') + except: + pass + sftp = paramiko.SFTP.from_transport(tc) + def test_2_write(self): """ verify that a file can be created and written, and the size is correct. |