From 0ab2735dd43b1ff18a122095b77c0d6031c27c91 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Sun, 7 Nov 2004 02:08:11 +0000 Subject: [project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-102] add key exchange tests + 1 more sftp test add test suite for key-exchange protocols, since i apparently broke the "gex" protocol recently and never noticed. also add an sftp unit test for mkdir/rmdir. --- tests/test_sftp.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests/test_sftp.py') diff --git a/tests/test_sftp.py b/tests/test_sftp.py index f112561b..64334fbc 100755 --- a/tests/test_sftp.py +++ b/tests/test_sftp.py @@ -385,3 +385,28 @@ class SFTPTest (unittest.TestCase): f = sftp.normalize('./' + FOLDER) self.assert_(len(f) > 0) self.assert_(f == pwd + '/' + FOLDER) + + def test_E_mkdir(self): + """ + verify that mkdir/rmdir work. + """ + try: + sftp.mkdir(FOLDER + '/subfolder') + except: + self.assert_(False, 'exception creating subfolder') + try: + sftp.mkdir(FOLDER + '/subfolder') + self.assert_(False, 'no exception overwriting subfolder') + except: + pass + try: + sftp.rmdir(FOLDER + '/subfolder') + except: + self.assert_(False, 'exception removing subfolder') + try: + sftp.rmdir(FOLDER + '/subfolder') + self.assert_(False, 'no exception removing nonexistent subfolder') + except: + pass + + -- cgit v1.2.3