summaryrefslogtreecommitdiff
path: root/test-sftpfs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-08-14 08:03:45 +0300
committerLars Wirzenius <liw@liw.fi>2015-08-14 08:38:01 +0300
commit993bc97f7f22e59de326f22e156b7b0e52d58a15 (patch)
tree6b9a8534a298999a9b21615535cb008f1afdb883 /test-sftpfs
parent77183fbd27a8327819247e770dce1a64e8043426 (diff)
downloadobnam-993bc97f7f22e59de326f22e156b7b0e52d58a15.tar.gz
Add test for root dir sftp url in test-sftp
Diffstat (limited to 'test-sftpfs')
-rwxr-xr-xtest-sftpfs17
1 files changed, 17 insertions, 0 deletions
diff --git a/test-sftpfs b/test-sftpfs
index 83a6c745..255b8c24 100755
--- a/test-sftpfs
+++ b/test-sftpfs
@@ -60,6 +60,23 @@ class SftpTests(unittest.TestCase, obnamlib.VfsTests):
self.fs.close()
shutil.rmtree(self.basepath)
+ def test_connect_to_remote_root_dir(self):
+ url = 'sftp://localhost/'
+ settings = {
+ 'pure-paramiko': False,
+ 'create': True,
+ 'sftp-delay': 0,
+ 'ssh-key': '',
+ 'strict-ssh-host-keys': False,
+ 'ssh-known-hosts': os.path.expanduser('~/.ssh/known_hosts'),
+ 'ssh-command': None,
+ 'ssh-host-keys-check': 'no',
+ }
+ fs = obnamlib.plugins.sftp_plugin.SftpFS(url, settings=settings)
+ fs.connect()
+ cwd = fs.getcwd()
+ self.assertEqual(cwd, '/')
+
def test_sets_path_to_absolute_path(self):
self.assertTrue(self.fs.path.startswith('/'))