summaryrefslogtreecommitdiffhomepage
path: root/tests/test_sftp.py
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2004-11-07 02:08:11 +0000
committerRobey Pointer <robey@lag.net>2004-11-07 02:08:11 +0000
commit0ab2735dd43b1ff18a122095b77c0d6031c27c91 (patch)
treecba5f1bc8f202533eee300f8238f7970e1f68e8e /tests/test_sftp.py
parenta97b9946bb87d380bb919814c0a51aa0307f9a8c (diff)
[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.
Diffstat (limited to 'tests/test_sftp.py')
-rwxr-xr-xtests/test_sftp.py25
1 files changed, 25 insertions, 0 deletions
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
+
+