]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
WIP
authorDavid Stainton <dstainton415@gmail.com>
Sat, 12 Sep 2015 18:27:10 +0000 (20:27 +0200)
committerDaira Hopwood <daira@jacaranda.org>
Tue, 15 Sep 2015 17:43:00 +0000 (18:43 +0100)
src/allmydata/frontends/magic_folder.py
src/allmydata/test/test_magic_folder.py

index 88f507db3619dcc9ba93cc502d1539edde672acd..b254b876c8e9187b8fb1c67899340eca88390cf2 100644 (file)
@@ -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)
index 2942be3e02916b4df09ecf441285e2301b93ab98..993e5f818ca97593cdec91f1dc8734ac7eacc48c 100644 (file)
@@ -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