From: Daira Hopwood Date: Mon, 8 Jun 2015 23:38:02 +0000 (+0100) Subject: Fix test errors. X-Git-Url: https://git.rkrishnan.org/%5B/frontends/%22news.html//%22%22.?a=commitdiff_plain;h=1504317e634970e1e28311d02c34d4f48d5974d8;p=tahoe-lafs%2Ftahoe-lafs.git Fix test errors. Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/client.py b/src/allmydata/client.py index ab06cfb0..b0d598ba 100644 --- a/src/allmydata/client.py +++ b/src/allmydata/client.py @@ -14,7 +14,7 @@ from allmydata.immutable.upload import Uploader from allmydata.immutable.offloaded import Helper from allmydata.control import ControlServer from allmydata.introducer.client import IntroducerClient -from allmydata.util import hashutil, base32, pollmixin, log, keyutil, idlib +from allmydata.util import fileutil, hashutil, base32, pollmixin, log, keyutil, idlib from allmydata.util.encodingutil import get_filesystem_encoding, \ from_utf8_or_none from allmydata.util.fileutil import abspath_expanduser_unicode @@ -508,7 +508,7 @@ class Client(node.Node, pollmixin.PollMixin): dbfile = abspath_expanduser_unicode(dbfile) parent_dircap_path = os.path.join(self.basedir, "private", "magic_folder_parent_dircap") - parent_dircap_path = abspath_expanduser_unicode(magic_folder_parent_dircap) + parent_dircap_path = abspath_expanduser_unicode(parent_dircap_path) parent_dircap = fileutil.read(parent_dircap_path).strip() s = drop_upload.DropUploader(self, upload_dircap, parent_dircap, local_dir, dbfile) diff --git a/src/allmydata/frontends/drop_upload.py b/src/allmydata/frontends/drop_upload.py index d4504328..4c4d017d 100644 --- a/src/allmydata/frontends/drop_upload.py +++ b/src/allmydata/frontends/drop_upload.py @@ -58,12 +58,7 @@ class DropUploader(service.MultiService): self._upload_deque = deque() self.is_upload_ready = False - if inotify is None: - if sys.platform == "win32": - from allmydata.windows import inotify - else: - from twisted.internet import inotify - self._inotify = inotify + self._inotify = inotify or get_inotify_module() if not self._local_path.exists(): raise AssertionError("The '[drop_upload] local.directory' parameter was %s " diff --git a/src/allmydata/test/test_client.py b/src/allmydata/test/test_client.py index e45fbb66..0547d7a0 100644 --- a/src/allmydata/test/test_client.py +++ b/src/allmydata/test/test_client.py @@ -328,6 +328,7 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test basedir1 = "test_client.Basic.test_create_drop_uploader1" os.mkdir(basedir1) + fileutil.write(os.path.join(basedir1, "tahoe.cfg"), config + "local.directory = " + local_dir_utf8 + "\n") self.failUnlessRaises(MissingConfigEntry, client.Client, basedir1) diff --git a/src/allmydata/test/test_drop_upload.py b/src/allmydata/test/test_drop_upload.py index 999e0be5..6be6d33c 100644 --- a/src/allmydata/test/test_drop_upload.py +++ b/src/allmydata/test/test_drop_upload.py @@ -362,7 +362,7 @@ class MockTest(DropUploadTestMixin, unittest.TestCase): raise NotImplementedError("blah") self.patch(drop_upload, 'get_inotify_module', _not_implemented) self.shouldFail(NotImplementedError, 'unsupported', 'blah', - DropUploader, client, upload_dircap, errors_dir, magicfolderdb) + DropUploader, client, upload_dircap, '', errors_dir, magicfolderdb) d.addCallback(_check_errors) return d