Fix test errors.
authorDaira Hopwood <daira@jacaranda.org>
Mon, 8 Jun 2015 23:38:02 +0000 (00:38 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Mon, 20 Jul 2015 23:20:56 +0000 (00:20 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/client.py
src/allmydata/frontends/drop_upload.py
src/allmydata/test/test_client.py
src/allmydata/test/test_drop_upload.py

index ab06cfb0490155761396c6bce0f36df8325976d4..b0d598ba60485b8b1bf90b3b9f38d3c4540c26e0 100644 (file)
@@ -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)
index d450432852e4ff01ecae45582d1f953a46045070..4c4d017d7733801f724e5fcecbab82b7ba60efc5 100644 (file)
@@ -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 "
index e45fbb6623f0c2963092acea1bc410ca6e14ba1e..0547d7a0af1a0e8db2fdca7574868ec73702ec40 100644 (file)
@@ -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)
index 999e0be56691a18f2b548dc11a8f4b9a14a73466..6be6d33cc6bdc5ad77dd033fcbc11132b2623011 100644 (file)
@@ -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