From 8025895b277af43ac50ca239af385debd43428d2 Mon Sep 17 00:00:00 2001 From: David Stainton Date: Sat, 12 Sep 2015 20:27:10 +0200 Subject: [PATCH] WIP --- src/allmydata/frontends/magic_folder.py | 1 + src/allmydata/test/test_magic_folder.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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 -- 2.45.2