From: David Stainton Date: Sat, 12 Sep 2015 18:27:10 +0000 (+0200) Subject: WIP X-Git-Url: https://git.rkrishnan.org/?a=commitdiff_plain;h=8025895b277af43ac50ca239af385debd43428d2;p=tahoe-lafs%2Ftahoe-lafs.git WIP --- diff --git a/src/allmydata/frontends/magic_folder.py b/src/allmydata/frontends/magic_folder.py index 88f507db..b254b876 100644 --- a/src/allmydata/frontends/magic_folder.py +++ b/src/allmydata/frontends/magic_folder.py @@ -285,6 +285,7 @@ class Uploader(QueueMixin): return None def _process(self, path_u): + print "_process %s" % (path_u,) precondition(isinstance(path_u, unicode), path_u) d = defer.succeed(None) diff --git a/src/allmydata/test/test_magic_folder.py b/src/allmydata/test/test_magic_folder.py index 2942be3e..993e5f81 100644 --- a/src/allmydata/test/test_magic_folder.py +++ b/src/allmydata/test/test_magic_folder.py @@ -207,7 +207,7 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual def create_test_file(result, filename): d2 = self.magicfolder.uploader.set_hook('processed') test_file = abspath_expanduser_unicode(filename, base=self.local_dir) - fileutil.write(test_file, "meow") + fileutil.write(test_file, "meow %s" % filename) self.notify(to_filepath(test_file), self.inotify.IN_CLOSE_WRITE) return d2 d.addCallback(lambda ign: create_test_file(ign, u"what1")) @@ -218,13 +218,15 @@ class MagicFolderTestMixin(MagicFolderCLITestMixin, ShouldFailMixin, ReallyEqual d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('uploader.objects_queued'), 0)) d.addCallback(self.cleanup) d.addCallback(self._restart_client) + d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('uploader.objects_succeeded'), 1)) + d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('uploader.objects_queued'), 0)) d.addCallback(lambda ign: create_test_file(ign, u"what2")) def fu2(ign): print "2nd upload complete" d.addBoth(fu2) - d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('uploader.objects_succeeded'), 1)) + d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('uploader.objects_succeeded'), 2)) d.addCallback(lambda ign: self.failUnlessReallyEqual(self._get_count('uploader.objects_queued'), 0)) d.addBoth(self.cleanup) return d