summaryrefslogtreecommitdiff
path: root/test-sftpfs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-07-11 10:04:34 +1200
committerLars Wirzenius <liw@liw.fi>2010-07-11 10:04:34 +1200
commit9f1433ff385beeb3a2af1cdcd29fa545b957c7c7 (patch)
tree238d23426156f57cd5a142b2ebe2c042c9845855 /test-sftpfs
parent2ed14960e3947e66aee2e07c0e53a0d05131139e (diff)
downloadobnam-9f1433ff385beeb3a2af1cdcd29fa545b957c7c7.tar.gz
Run tests on localhost.
Diffstat (limited to 'test-sftpfs')
-rw-r--r--test-sftpfs11
1 files changed, 9 insertions, 2 deletions
diff --git a/test-sftpfs b/test-sftpfs
index 49d4f62c..c3eff5dd 100644
--- a/test-sftpfs
+++ b/test-sftpfs
@@ -20,10 +20,15 @@
This can't be part of the normal unit tests, since it requires access
to a (real) ssh server.
+To run these tests, you must arrange for localhost to be able to accept
+ssh connections using the ssh agent.
+
'''
import os
+import shutil
+import tempfile
import unittest
import obnamlib
@@ -33,12 +38,14 @@ import obnamlib.plugins.sftp_plugin
class SftpTests(unittest.TestCase, obnamlib.VfsTests):
def setUp(self):
- self.baseurl = os.environ['OBNAM_SFTP_TEST']
- self.fs = obnamlib.plugins.sftp_plugin.SftpFS(self.baseurl)
+ self.dirname = tempfile.mkdtemp()
+ baseurl = 'sftp://localhost/%s' % self.dirname
+ self.fs = obnamlib.plugins.sftp_plugin.SftpFS(baseurl)
self.fs.connect()
def tearDown(self):
self.fs.close()
+ shutil.rmtree(self.dirname)
def test_initial_cwd_is_basepath(self):
self.assertEqual(self.fs.getcwd(), self.fs.basepath)